Link to home
Start Free TrialLog in
Avatar of AdrianJMartin
AdrianJMartin

asked on

Refresh IsInRole Cache

I've setup an application that uses IsInRole to determine a users rights.
When I change a user's group membership in Active Directory, to grant a different level of access, IsInRole does not notice. I'm guessing the Logon info is cached.

There must be a way to Refresh the information without asking a user to restart his machine to get the new set of roles.
Avatar of ihenry
ihenry

Yes, it won't refresh the current IPrincipal object created. One way is to requery to Active Directory and refresh the Thread.CurrentPrincipal value with the latest information.
Avatar of AdrianJMartin

ASKER

I've created a class that maintains a more up to date group membership( It caches and only refreshes at pertinate times to stop overloading the AD servers). Which works great and taught me quite a bit about ad/ds.

shame there is no :
    Thread.CurrentPrincipal().Refresh() method;




ASKER CERTIFIED SOLUTION
Avatar of ihenry
ihenry

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial