Version 5.0.14
This commit is contained in:
1 parent
5efe744c5f
commit
dbd774b30c
364 files changed
+7048
-1377
No files matched your search
@@ -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' ) )
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user