Logout user if role is changed mid-session |
I am developing a login system where there are multiple user roles (admin, editor, user, etc). What is the best way to immediately destroy the session of a user that is currently logged in if their user role is changed by an admin?
For example, user [email protected] has a current role of "editor" which allows him to add and edit newsletters on the site. He has proven himself to be a bad content manager, but he still must be able to read those newsletters. The admin has been asked to demote sneaky's role from "editor" to "user" which only has read access to the newsletters. The admin changes his role immediately, but [email protected] was logged in at the time. He is still identified as an "editor" by his active session. Sneaky needs to be logged out right away and forced to log back in for his new "user" role to take effect. What is the best way for sneaky's session to be automatically destroyed when his role is changed by the admin? |
Messages In This Thread |
Logout user if role is changed mid-session - by mlurie - 07-23-2020, 04:49 PM
RE: Logout user if role is changed mid-session - by tgix - 07-23-2020, 11:33 PM
RE: Logout user if role is changed mid-session - by mlurie - 07-28-2020, 06:36 PM
|