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
/printthread.php 16 require_once



UserSpice
How to use hasPerm - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.4 (https://userspice.com/forums/forumdisplay.php?fid=27)
+--- Thread: How to use hasPerm (/showthread.php?tid=1586)



How to use hasPerm - Aido - 07-20-2019

I try to use this function in my code 
but even using the 
var_dump(((hasPerm([2],$user->data()->id))))

generates the problem with other code first with JS part. without it the code works fine but i need to control some permissions.

I understand it is a kind of interference with something but I have no idea where...

What am i doing wrong?

I've checked the hasPerm implementation and found that I can skip the id parameter and it will be set by hasPerm itself so i deleted the id.
The short version with permissions only works in my case.


RE: How to use hasPerm - mudmin - 07-20-2019

What are you trying to accomplish? I don't see any javascript there. Try this

if(hasPerm([2],$user->data()->id)){
die("Has permission);
}else{
die("Does not have permission");
}