I think at some situations users don't want the role to be changed permanently.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | roleswitcher-feature_dont_save_user_roles-1853690-1.patch | 1.84 KB | hkirsman |
I think at some situations users don't want the role to be changed permanently.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | roleswitcher-feature_dont_save_user_roles-1853690-1.patch | 1.84 KB | hkirsman |
Comments
Comment #1
hkirsman commentedHere's a working demo of this feature. Needs more testing, probably a admin infterface to switch between the old and new feature.
Comment #2
vaartio commentedThis is an interesting approach. It has pros and cons. A clear advantage is that overriding the actual roles of a user from the database doesn't make possible to switch the role to anonymous. Session storage makes it possible. One disadvantage is that some modules may check permissions by loading user object again from the database.
I applied your patch and add an admin user interface and fixed couple things. There's a brand new release candidate available now.
Comment #3
hkirsman commentedCool!
About the disadvantage, maby duplicate the code in hook_boot to hook_user_load?
Comment #5
vaartio commented