05-10-2017, 11:33 AM
I have a hierarcy of roles determined by the permission group: USER -> SUPERVISOR -> SUPERUSER -> ADMIN
An individual user can only be within one role. Users can not self-register so I define their role when I manually create their account.
Multiple roles can access individual pages - for example, page1.php can be used by USER & SUPERVISOR; page2.php is only accessible by SUPERUSER role...
I wanted to control certain privileges within my PHP by referencing the role that the logged on person currently has - a USER role being able to update less columns than a person in a SUPERVISOR role for example. If I check the "permissions" attribute of the user data though ($user->data()->permissions) this seems to be always set to 1. I was expecting it to reflect the role of the user as defined when it was created.
Is there anyway I can get to the role the user account is actually created as?
Sorry if I have completely missed the logic around permissions
An individual user can only be within one role. Users can not self-register so I define their role when I manually create their account.
Multiple roles can access individual pages - for example, page1.php can be used by USER & SUPERVISOR; page2.php is only accessible by SUPERUSER role...
I wanted to control certain privileges within my PHP by referencing the role that the logged on person currently has - a USER role being able to update less columns than a person in a SUPERVISOR role for example. If I check the "permissions" attribute of the user data though ($user->data()->permissions) this seems to be always set to 1. I was expecting it to reflect the role of the user as defined when it was created.
Is there anyway I can get to the role the user account is actually created as?
Sorry if I have completely missed the logic around permissions