The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using UserSpice permissions in my own code
#1
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 Sad
  Reply


Messages In This Thread
Using UserSpice permissions in my own code - by grumpy-gnome - 05-10-2017, 11:33 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)