The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (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
Is function checkPermission($permission) valid to use?
#3
You can definitely treat permission levels as groups. They don't have to be segregated with one necessarily being higher than the other one. Another function called checkMenu essentially does the same thing if you want specific permission levels to see certain things.

I need to do a write up on the whole permission thing.

Essentially when you create a permission level, it gets and id. You can even see the id from the backend when you click on the permission.

When you add a page's visibility to a certain permission group, a new line is created in permission_page_matches in the database. That line has both the page id and the permission level id.

Finally, when you give a permission level to a user, there is a line added in the db table user_permission_matches with the user's id and the permission level.

So you basically have this triangle needed to access a page (user_id, permission_id, page_id).

So user 1 goes to a page... UserSpice looks up all the permission ids that are linked to that user_id. Then it looks at the page and sees what permission_ids are allowed to visit that page_id. If everything lines up, you're let in.

I hope that helps.

  Reply


Messages In This Thread
Is function checkPermission($permission) valid to use? - by mudmin - 09-01-2016, 11:38 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)