Version 5.0.14

This commit is contained in:
Neo committed 2025-12-19 19:17:57 -08:00
1 parent 5efe744c5f
commit dbd774b30c
364 files changed
+7048 -1377

No files matched your search

+9 -2
View File
@@ -21,6 +21,7 @@ use IPS\Dispatcher;
use IPS\Extensions\PermissionsAbstract;
use IPS\IPS;
use IPS\Member;
use IPS\Member\Group;
use IPS\Node\Model;
use IPS\Settings;
@@ -121,11 +122,17 @@ class Permissions
*
* @param string $permission
* @param object $object
* @param Member|null $member
* @param Member|Group|null $member
* @return int
*/
public static function can( string $permission, object $object, ?Member $member=null ) : int
public static function can( string $permission, object $object, Member|Group|null $member=null ) : int
{
/* Rather than do a breaking change, skip this check if we pass in a group */
if( $member instanceof Group )
{
return static::PERM_DEFAULT;
}
/* Only allow these extensions to run on the front-end or from the API */
if( !Dispatcher::hasInstance() or ( Dispatcher::i()->controllerLocation != 'front' and Dispatcher::i()->controllerLocation != 'api' ) )
{