Permission extends BitSet
A class providing constants for bitwise operations on page access check
Table of Contents
Constants
- ALL = 31
- CONTENT_EDIT = 16
- NOTHING = 0
- PAGE_DELETE = 4
- PAGE_EDIT = 2
- PAGE_NEW = 8
- PAGE_SHOW = 1
Properties
- $set : int
Methods
- __construct() : mixed
- __toInt() : int
- Returns the integer representation of the internal set.
- __toString() : string
- Returns the (binary) string representation of the internal (integer) set.
- and() : void
- Performs a logical AND of this target bit set with the argument bit set. This bit set is modified so that each bit in it has the value true if and only if it both initially had the value true and the corresponding bit in the bit set argument also had the value true.
- andNot() : void
- Clears all of the bits in this BitSet whose corresponding bit is set in the specified BitSet.
- clear() : void
- Sets all of the bits in this BitSet to false.
- createPagePermissionIsGranted() : bool
- deletePagePermissionIsGranted() : bool
- editContentPermissionIsGranted() : bool
- editPagePermissionIsGranted() : bool
- get() : bool
- getMap() : array<string|int, mixed>
- Permission mapping Used for instance in PageTS
- isGranted() : bool
- nothingIsGranted() : bool
- or() : void
- Performs a logical OR of this bit set with the bit set argument. This bit set is modified so that a bit in it has the value true if and only if it either already had the value true or the corresponding bit in the bit set argument has the value true.
- set() : void
- Performs the same operation as {@see or()} without the need to create a BitSet instance from an integer value.
- setValue() : void
- showPagePermissionIsGranted() : bool
- unset() : void
- Performs the same operation as {@see andNot()} without the need to create a BitSet instance from an integer value.
- xor() : void
- Performs a logical XOR of this bit set with the bit set argument. This bit set is modified so that a bit in it has the value true if and only if one of the following statements holds:
Constants
ALL
public
int
ALL
= 31
CONTENT_EDIT
public
int
CONTENT_EDIT
= 16
NOTHING
public
int
NOTHING
= 0
PAGE_DELETE
public
int
PAGE_DELETE
= 4
PAGE_EDIT
public
int
PAGE_EDIT
= 2
PAGE_NEW
public
int
PAGE_NEW
= 8
PAGE_SHOW
public
int
PAGE_SHOW
= 1
Properties
$set
protected
int
$set
Methods
__construct()
public
__construct([int $set = 0 ]) : mixed
Parameters
- $set : int = 0
__toInt()
Returns the integer representation of the internal set.
public
__toInt() : int
(As PHP does not know a byte type, the internal set is already handled as an integer and can therefore directly be returned)
Return values
int__toString()
Returns the (binary) string representation of the internal (integer) set.
public
__toString() : string
Return values
stringand()
Performs a logical AND of this target bit set with the argument bit set. This bit set is modified so that each bit in it has the value true if and only if it both initially had the value true and the corresponding bit in the bit set argument also had the value true.
public
and(BitSet $set) : void
Parameters
- $set : BitSet
andNot()
Clears all of the bits in this BitSet whose corresponding bit is set in the specified BitSet.
public
andNot(BitSet $set) : void
Parameters
- $set : BitSet
clear()
Sets all of the bits in this BitSet to false.
public
clear() : void
createPagePermissionIsGranted()
public
createPagePermissionIsGranted() : bool
Return values
booldeletePagePermissionIsGranted()
public
deletePagePermissionIsGranted() : bool
Return values
booleditContentPermissionIsGranted()
public
editContentPermissionIsGranted() : bool
Return values
booleditPagePermissionIsGranted()
public
editPagePermissionIsGranted() : bool
Return values
boolget()
public
get(int $bitIndex) : bool
Parameters
- $bitIndex : int
Return values
boolgetMap()
Permission mapping Used for instance in PageTS
public
static getMap() : array<string|int, mixed>
Return values
array<string|int, mixed>isGranted()
public
isGranted(int $permission) : bool
Parameters
- $permission : int
Return values
boolnothingIsGranted()
public
nothingIsGranted() : bool
Return values
boolor()
Performs a logical OR of this bit set with the bit set argument. This bit set is modified so that a bit in it has the value true if and only if it either already had the value true or the corresponding bit in the bit set argument has the value true.
public
or(BitSet $set) : void
Parameters
- $set : BitSet
set()
Performs the same operation as {@see or()} without the need to create a BitSet instance from an integer value.
public
set(int $bitIndex) : void
Parameters
- $bitIndex : int
setValue()
public
setValue(int $bitIndex, bool $value) : void
Parameters
- $bitIndex : int
- $value : bool
showPagePermissionIsGranted()
public
showPagePermissionIsGranted() : bool
Return values
boolunset()
Performs the same operation as {@see andNot()} without the need to create a BitSet instance from an integer value.
public
unset(int $bitIndex) : void
Parameters
- $bitIndex : int
xor()
Performs a logical XOR of this bit set with the bit set argument. This bit set is modified so that a bit in it has the value true if and only if one of the following statements holds:
public
xor(BitSet $set) : void
- The bit initially has the value true, and the corresponding bit in the argument has the value false.
- The bit initially has the value false, and the corresponding bit in the argument has the value true.
Parameters
- $set : BitSet