The following warnings occurred: | ||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
Suggested new function in US_helpers.php - Printable Version +- UserSpice (https://userspice.com/forums) +-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28) +--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29) +--- Thread: Suggested new function in US_helpers.php (/showthread.php?tid=239) |
Suggested new function in US_helpers.php - plb - 09-04-2016 The current definition of Code: checkPermissions() I am suggesting a new function called Code: hasPermission() Code: checkPermissions() Code: hasPermission() I will confess I am happy with the stability of Code: hasPermission() Code: checkPermissions() Code: checkPermission() http://pastebin.com/cexD5maq This provides a more generic way to check if a user (either the current user or someone else) has a given permission/group. Suggested new function in US_helpers.php - mudmin - 09-06-2016 I like that. The old permission names and even what they do was somewhat setup like that for backwards compatibility, but I like having the more generic function. Btw, technically you can still patch a usercake 2.0 project (from 2010 or something) all the way up to 4.1.4 if you're willing to do a little fiddling. |