Freeze the user

Hello 

I want to apply new policy in my company on condition. I want to freeze the user to go anywhere except if he accept the policy .. how can I apply it? 

 To be acknowledge this is not one application it's more than one and all under the same company .


Regards,

mvp_badge
MVP
Solution

Hi Yousef,


Working on Traditional Web, my suggestion is to do this check on the Preparation of the Layout. Doing it on the layout, allows it to reuse it on every screen using the layout, instead of doing the check on every single screen.

Your Preparation flow should look like this, where you do the check if the user has accepted and if it doesn't you redirect him to a given screen, for example, No Permissions screen.

Make sure that you don't do this check on the No Permission Screen, otherwise you'll have a loop.


Kind Regards,
João

Solution

Good answer :) This will check on the layout and not on each screen what is great!! So, Yousef will not need the roles. Just need to add an attribute to the user entity or other entity that controls if the user has accepted the policy or not and then he checks that on the layout preparation. :)


Thank you a lot for helping me 

this solution works fine :) 

Solution

Good answer :) This will check on the layout and not on each screen what is great!! So, Yousef will not need the roles. Just need to add an attribute to the user entity or other entity that controls if the user has accepted the policy or not and then he checks that on the layout preparation. :)


This is just me thinking, can you not create a role for those who have accepted the policy? and then you just need to enable that role on your screens, then just people who have accepted the policy can enter the screen.

You just need to be cautious to remove the active role register to not active, because if the person didn't accept the policies he can enter also on the screen with the registered role.

Let me know what you think

´Kind Regards,

Márcio




mvp_badge
MVP
Solution

Hi Yousef,


Working on Traditional Web, my suggestion is to do this check on the Preparation of the Layout. Doing it on the layout, allows it to reuse it on every screen using the layout, instead of doing the check on every single screen.

Your Preparation flow should look like this, where you do the check if the user has accepted and if it doesn't you redirect him to a given screen, for example, No Permissions screen.

Make sure that you don't do this check on the No Permission Screen, otherwise you'll have a loop.


Kind Regards,
João

Solution

Good answer :) This will check on the layout and not on each screen what is great!! So, Yousef will not need the roles. Just need to add an attribute to the user entity or other entity that controls if the user has accepted the policy or not and then he checks that on the layout preparation. :)


Thank you a lot for helping me 

this solution works fine :) 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.