Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesIsinRoles not returning true for role just addedIsinRoles not returning true for role just added
Previous
 
Next
New Post
8/9/2011 10:17 AM
 
I am trying to code and administration module for my company.

I have a checkbox list of roles.  The administrator will check the role(s) they want to administer and then choose the user.  Then there are two buttons, one to 'add' and one to 'remove'.  (rolecontroller.adduserrole and rolecontroller.deleteuserrole)

Both of these methods work fine.  They add or remove the user to/from the role.  I can tell it works by logging in as that user. 

However, if you press one button and then immediately press the other, it fails.  This is because before doing the add or remove, I have a userinfo.isinrole check.  This check does not reflect the most recent change.

If I click 'add', wait 15-20 minutes, and then click remove I'm all set.  I can also click 'remove', wait 15-20 minutes and then click add.  There is only a problem when I try to do one immediately after doing the other. 

I'm assuming there is some caching that is occuring that needs to be cleared, but I have tried all of the cache removal suggestions I found by googling and have had no luck.  Can someone help? 

Thanks!!
 
New Post
8/9/2011 2:25 PM
 
the user's roles with be cached in their portalroles cookie so you need to expire that users portalrole - if you're doing this for other users they will need to log out and log back in to see the changes immeadiately. Note: roles are only cached for 1 minute, Im not sure why you see a 15 minute delay.

Buy the new Professional DNN7: Open Source .NET CMS Platform book Amazon US
 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsModulesModulesIsinRoles not returning true for role just addedIsinRoles not returning true for role just added


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out