mikemclin / angular-acl

Role-based permissions for AngularJS
196 stars 49 forks source link

AclService showing old value for "can" #18

Closed samarthagarwal closed 8 years ago

samarthagarwal commented 8 years ago

Hi. I am using AngularUIRouter. I assign a role to a user based on the user type, say I have two types X and Y. Consider two users, A and B, of type X and Y respectively. Now when user A logs in, he is properly assigned the role X and if I try AclService.can('somethingThatOnlyXCanDo'), I get 'true'. Now when A logs out and B logs in, AclService.can('somethingThatOnlyXCanDo') still gives me true, when It should actually be false. I have to hard refresh the app to get the correct value.

Is there an issue with Angular UI Router or am I forgetting something?

mikemclin commented 8 years ago

Did you remove all of the roles for the authenticated user when they logged out using AclService.flushRoles()?

It sounds like you are logging a user out, but never notifying the AclService that the roles need to be flushed.

mikemclin commented 8 years ago

Closing due to inactivity. Please reopen if you're still having a problem.