09-03-2017, 11:26 AM
There is no function, your best bet is to do the following:
http://pasted.co/d92c20c9
Replace ***USER ID HERE*** with $user->data()->id or the user ID you defined in whatever variable.
You will simply echo $userPerm and it will echo it.
NOTE: If the user has more than 1 perm, it will echo the lowest ID (e.g. user before admin). You might want to add a "importance" value in your permissions table and add an Order By to the query.
If you want to make that a function, you can put it in custom functions with a name and your DB:get instance and define the variable.
http://pasted.co/d92c20c9
Replace ***USER ID HERE*** with $user->data()->id or the user ID you defined in whatever variable.
You will simply echo $userPerm and it will echo it.
NOTE: If the user has more than 1 perm, it will echo the lowest ID (e.g. user before admin). You might want to add a "importance" value in your permissions table and add an Order By to the query.
If you want to make that a function, you can put it in custom functions with a name and your DB:get instance and define the variable.