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
Suggested new function in US_helpers.php
#1
The current definition of
Code:
checkPermissions()
is somewhat special-purpose and (perhaps) obsolete.

I am suggesting a new function called
Code:
hasPermission()
which is a little more general-purpose and will change the definition of
Code:
checkPermissions()
to simply call
Code:
hasPermission()
with the appropriate parameter.

I will confess I am happy with the stability of
Code:
hasPermission()
(I have tested it) whereas I don't use
Code:
checkPermissions()
at all and so I haven't tested whether my change is backward compatible. [honesty strikes] OK, I haven't tested my definition of
Code:
checkPermission()
at all - I just typed it into the pastebin. Phew, conscience relieved. :-)

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.
  Reply


Messages In This Thread
Suggested new function in US_helpers.php - by plb - 09-04-2016, 02:13 PM

Forum Jump:


Users browsing this thread: 3 Guest(s)