tires Posted October 19, 2022 Share Posted October 19, 2022 HI! I would like to show some fields (checkboxes) in the user profile depending on the role of the user. I.e. If the user has the role "checker 1" the first check box i shown when he is editing his profile. If the user has the role "checker 2" the second check box i shown in his profile. BTW. I am using the LoginRegister module for users to edit they profile if this makes a difference. Link to comment Share on other sites More sharing options...
3fingers Posted October 19, 2022 Share Posted October 19, 2022 A combination of this module and the right selector: $user->hasRole($role) should do the trick ;) 1 Link to comment Share on other sites More sharing options...
tires Posted October 19, 2022 Author Share Posted October 19, 2022 Thank you! While trying to implement your solution I found an even easier way. I restricted the access in the field settings to specific roles. This works pretty well! Link to comment Share on other sites More sharing options...
tires Posted October 19, 2022 Author Share Posted October 19, 2022 To allow the user to check the box, I need to give the role permission to view and edit the field. I also apparently need to give the role page editing permission ... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now