Version 5.0.13
This commit is contained in:
1 parent
b89858b2ff
commit
5efe744c5f
1407 files changed
+69690
-30177
No files matched your search
@@ -13,6 +13,7 @@ namespace IPS\Content;
|
||||
use BadMethodCallException;
|
||||
use IPS\Member;
|
||||
|
||||
use IPS\Request;
|
||||
use function defined;
|
||||
use function get_class;
|
||||
use function header;
|
||||
@@ -61,6 +62,18 @@ trait Lockable
|
||||
*/
|
||||
public function canLock( ?Member $member=NULL ): bool
|
||||
{
|
||||
/* Is this the task? Let it through */
|
||||
if( Request::i()->isCliEnvironment() )
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/* Extensions go first */
|
||||
if( $permCheck = Permissions::can( 'lock', $this, $member ) )
|
||||
{
|
||||
return ( $permCheck === Permissions::PERM_ALLOW );
|
||||
}
|
||||
|
||||
if( !$this->actionEnabled( 'lock', $member ) )
|
||||
{
|
||||
return false;
|
||||
@@ -94,6 +107,12 @@ trait Lockable
|
||||
*/
|
||||
public function canUnlock( ?Member $member=NULL ): bool
|
||||
{
|
||||
/* Extensions go first */
|
||||
if( $permCheck = Permissions::can( 'unlock', $this, $member ) )
|
||||
{
|
||||
return ( $permCheck === Permissions::PERM_ALLOW );
|
||||
}
|
||||
|
||||
if( !$this->actionEnabled( 'unlock', $member ) )
|
||||
{
|
||||
return false;
|
||||
|
||||
Reference in new issue
Block a user