RT 4.4.3 Documentation

RT::ACE

Go to latest version →

SYNOPSIS

  use RT::ACE;
  my $ace = RT::ACE->new($CurrentUser);

DESCRIPTION

METHODS

Rights

# Queue rights are the sort of queue rights that can only be granted # to real people or groups

LoadByValues PARAMHASH

Load an ACE by specifying a paramhash with the following fields:

              PrincipalId => undef,
              PrincipalType => undef,
              RightName => undef,

        And either:

              Object => undef,

            OR

              ObjectType => undef,
              ObjectId => undef

Create <PARAMS>

PARAMS is a parameter hash with the following elements:

   PrincipalId => The id of an RT::Principal object
   PrincipalType => "User" "Group" or any Role type
   RightName => the name of a right. in any case


    Either:

   Object => An object to create rights for. ususally, an RT::Queue or RT::Group
             This should always be a DBIx::SearchBuilder::Record subclass

        OR

   ObjectType => the type of the object in question (ref ($object))
   ObjectId => the id of the object in question $object->Id



   Returns a tuple of (STATUS, MESSAGE);  If the call succeeded, STATUS is true. Otherwise it's false.

Delete { InsideTransaction => undef}

Delete this object. This method should ONLY ever be called from RT::User or RT::Group (or from itself) If this is being called from within a transaction, specify a true value for the parameter InsideTransaction. Really, DBIx::SearchBuilder should use and/or fake subtransactions

This routine will also recurse and delete any delegations of this right

_BootstrapCreate

Grant a right with no error checking and no ACL. this is _only_ for installation. If you use this routine without the author's explicit written approval, he will hunt you down and make you spend eternity translating mozilla's code into FORTRAN or intercal.

If you think you need this routine, you've mistaken.

InvalidateCaches

Calls any registered ACL cache handlers (see "RegisterCacheHandler").

Usually called from "Create" and "Delete".

RegisterCacheHandler

Class method. Takes a coderef and adds it to the ACL cache handlers. These handlers are called by "InvalidateCaches", usually called itself from "Create" and "Delete".

The handlers are passed a hash which may contain any (or none) of these optional keys:

Action

A string indicating the action that (may have) invalidated the cache. Expected values are currently:

Grant
Revoke

However, other values may be passed in the future.

RightName

The (canonicalized) right being granted or revoked.

ACE

The RT::ACE object just created.

Your handler should be flexible enough to account for additional arguments being passed in the future.

CanonicalizeRightName <RIGHT>

Takes a queue or system right name in any case and returns it in the correct case. If it's not found, will return undef.

Object

If the object this ACE applies to is a queue, returns the queue object. If the object this ACE applies to is a group, returns the group object. If it's the system object, returns undef.

If the user has no rights, returns undef.

PrincipalObj

Returns the RT::Principal object for this ACE.

_CanonicalizePrincipal (PrincipalId, PrincipalType)

Takes a principal id and a principal type.

If the principal is a user, resolves it to the proper acl equivalence group. Returns a tuple of (RT::Principal, PrincipalType) for the principal we really want to work with

id

Returns the current value of id. (In the database, id is stored as int(11).)

PrincipalType

Returns the current value of PrincipalType. (In the database, PrincipalType is stored as varchar(25).)

SetPrincipalType VALUE

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(25).)

PrincipalId

Returns the current value of PrincipalId. (In the database, PrincipalId is stored as int(11).)

SetPrincipalId VALUE

Set PrincipalId to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, PrincipalId will be stored as a int(11).)

RightName

Returns the current value of RightName. (In the database, RightName is stored as varchar(25).)

SetRightName VALUE

Set RightName to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, RightName will be stored as a varchar(25).)

ObjectType

Returns the current value of ObjectType. (In the database, ObjectType is stored as varchar(25).)

SetObjectType VALUE

Set ObjectType to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, ObjectType will be stored as a varchar(25).)

ObjectId

Returns the current value of ObjectId. (In the database, ObjectId is stored as int(11).)

SetObjectId VALUE

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).)

Creator

Returns the current value of Creator. (In the database, Creator is stored as int(11).)

Created

Returns the current value of Created. (In the database, Created is stored as datetime.)

LastUpdatedBy

Returns the current value of LastUpdatedBy. (In the database, LastUpdatedBy is stored as int(11).)

LastUpdated

Returns the current value of LastUpdated. (In the database, LastUpdated is stored as datetime.)

← Back to index