Returns true if this principal is a group. Returns undef, otherwise
Returns true if this principal is a User. Returns undef, otherwise
Returns the user or group associated with this principal
A helper function which calls RT::ACE->Create
Returns a tuple of (STATUS, MESSAGE); If the call succeeded, STATUS is true. Otherwise it's
false.
Delete a right that a user has
Returns a tuple of (STATUS, MESSAGE); If the call succeeded, STATUS is true. Otherwise it's
false.
Checks to see whether this principal has the right "Right" for the Object specified. This takes the params:
name of a right
an RT style object (->id will get its id)
Returns 1 if a matching ACE was found. Returns undef if no ACE was found.
Use "HasRights" to fill a fast cache, especially if you're going to check many different rights with the same principal and object.
Returns a hash reference with all rights this principal has on an object. Takes Object as a named argument.
Main use case of this method is the following:
$ticket->CurrentUser->PrincipalObj->HasRights( Object => $ticket );
...
$ticket->CurrentUserHasRight('A');
...
$ticket->CurrentUserHasRight('Z');
Results are cached and the cache is used in this and, as well, in "HasRight" method speeding it up. Don't use hash reference returned by this method directly for rights checks as it's more complicated then it seems, especially considering config options like 'DisallowExecuteCode'.
Low level HasRight implementation, use HasRight method instead.
Returns list with names of roles that have right on set of objects. Takes Right, EquiveObjects, IncludeSystemRights and IncludeSuperusers arguments.
IncludeSystemRights is true by default, rights granted systemwide are ignored when IncludeSystemRights is set to a false value.
IncludeSuperusers is true by default, SuperUser right is not checked if it's set to a false value.
Cleans out and reinitializes the user rights cache
Gets the principal type. if it's a user, it's a user. if it's a role group and it has a Type, return that. if it has no type, return group.
Returns a list uniquely representing an object or normal scalar.
For a scalar, its string value is returned. For an object that has an id() method which returns a value, its class name and id are returned as a string separated by a "-". For an object that has an id() method which returns false, its class name is returned.
Returns the current value of id. (In the database, id is stored as int(11).)
Returns the current value of PrincipalType. (In the database, PrincipalType is stored as varchar(16).)
Set PrincipalType to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, PrincipalType will be stored as a varchar(16).)
Returns the current value of ObjectId. (In the database, ObjectId is stored as int(11).)
Set ObjectId to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, ObjectId will be stored as a int(11).)
Returns the current value of Disabled. (In the database, Disabled is stored as smallint(6).)
Set Disabled to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Disabled will be stored as a smallint(6).)
← Back to index