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
#2
No problem. That permissions in the user table is more about ability to access the site as a whole. I think you're looking for this.....


hasPerm ([permission levels],user’s id)
The venerable, old checkMenu function from the UserCake days was nice, but not really flexible as your number of permission levels grew. So, we have also added hasPerm. If you want something to show up (or not show up) or go through (or fail) based on a person’s permission level, you can now pass in an array.

if (hasPerm([2,103],$user->data()->id)){
//do something
}

You can pass in as many permission levels as you want into that [] array. Permission level ids can be found by going to the Admin dashboard and manage your permission levels. Click on one to get its id. Note that if you don’t make that first argument an array [] , it will throw an error, so use [] even if it is only for one permission level.
  Reply


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

Forum Jump:


Users browsing this thread: 1 Guest(s)