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



UserSpice
Menu Permissions & Viewing - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: Menu Permissions & Viewing (/showthread.php?tid=186)



Menu Permissions & Viewing - A.Long - 07-17-2016

Just a brief question, I've got multiple permission levels setup, lets say levels 2, 3, 4, and 5. I've got multiple dropdown menus in my menu. I want menu dropdown option 1 to be visible to permissions 2 and 3, and then menu dropdown option 2 to be visible to permissions 4 and 5. Is there a way to do this? I've been messing around with the code below, but can't seem to get it to work properly for multiple permissions

<?php if (checkMenu(#,$user->data()->id)){?>
Content
<?php } ?>


Menu Permissions & Viewing - mudmin - 07-17-2016

My logic might be a little bit off but you can probably do

<pre>
Code:
if (checkMenu(3,$user->data()->id) || (checkMenu(4,$user->data()->id)){
</pre>

Code:
//Links for permission level 3/4

Code:
?>

There may be a missing or added () in there somewhere


Menu Permissions & Viewing - A.Long - 07-19-2016

Found my error in your mention of the ().

For anyone who may encounter the same issue, what worked for me was:

<pre>
Code:
<?php if (checkMenu(2,$user->data()->id) || checkMenu(7,$user->data()->id) || checkMenu(8,$user->data()->id) || checkMenu(9,$user->data()->id) || checkMenu(12,$user->data()->id) || checkMenu(13,$user->data()->id)){?>
</pre>