RT::Group - RT's group object
use RT::Group; my $group = RT::Group->new($CurrentUser);
An RT group object.
Returns a user-readable description of what this group is for and what it's named.
Load a group object from the database. Takes a single argument. If the argument is numerical, load by the column 'id'. Otherwise, complain and return.
Loads a system group from the database. The only argument is the group's name.
Loads a user's acl equivalence group. Takes a principal object or its ID. ACL equivalnce groups are used to simplify the acl system. Each user has one group that only he is a member of. Rights granted to the user are actually granted to that group. This greatly simplifies ACL checks. While this results in a somewhat more complex setup when creating users and granting ACLs, it _greatly_ simplifies acl checks.
Loads a Pseudo group from the database. The only argument is the group's name.
Takes a paramhash of Object and Name and attempts to load the suitable role group for said object.
Deprecated in favor of "LoadRoleGroup" or "RoleGroup" in RT::Record.
Deprecated in favor of "LoadRoleGroup" or "RoleGroup" in RT::Record.
Deprecated in favor of "LoadRoleGroup" or "RoleGroup" in RT::Record.
You need to specify what sort of group you're creating by calling one of the other Create_____ routines.
Takes a paramhash with named arguments: Name, Description.
Returns a tuple of (Id, Message). If id is 0, the create failed
A helper subroutine which creates a system group
Returns a tuple of (Id, Message). If id is 0, the create failed
Enforces unique user defined group names when updating
Returns true if the user defined group name isn't in use, false otherwise.
A helper subroutine which creates a group containing only an individual user. This gets used by the ACL system to check rights. Yes, it denormalizes the data, but that's ok, as we totally win on performance.
Returns a tuple of (Id, Message). If id is 0, the create failed
A convenience method for creating a role group on an object.
This method expects to be called from inside of a database transaction! If you're calling it outside of one, you MUST pass a false value for InsideTransaction.
Takes a paramhash of:
Required. RT's core role types are Requestor
, Cc
, AdminCc
, and Owner
. Extensions may add their own.
Optional. The object on which this role applies, used to set Domain and Instance automatically.
Optional. The class on which this role applies, with -Role
appended. RT's supported core role group domains are RT::Ticket-Role
, RT::Queue-Role
, and RT::System-Role
.
Not required if you pass an Object.
Optional. The numeric ID of the object (of the class encoded in Domain) on which this role applies. If Domain is RT::System-Role
, Instance should be 1
.
Not required if you pass an Object.
Optional. Defaults to true in expectation of usual call sites. If you call this method while not inside a transaction, you MUST
pass a false value for this parameter.
You must pass either an Object or both Domain and Instance.
Returns a tuple of (id, Message). If id is false, the create failed and Message should contain an error string.
Takes a param hash containing Domain and Type which are expected to be values passed into "CreateRoleGroup". Returns true if the specified Type is a registered role on the specified Domain. Otherwise returns false.
Delete this object
If passed a positive value, this group will be disabled. No rights it commutes or grants will be honored. It will not appear in most group listings.
This routine finds all the cached group members that are members of this group (recursively) and disables them.
Returns an RT::CachedGroupMembers object of this group's members, including all members of subgroups.
Returns an RT::GroupMembers object of this group's direct members.
Returns an RT::Groups object of this group's members. By default returns groups including all subgroups, but could be changed with Recursively
named argument.
Note that groups are not filtered by type and result may contain as well system groups and others.
Returns an RT::Users object of this group's members, by default returns users including all members of subgroups, but could be changed with Recursively
named argument.
Returns an array of the email addresses of all of this group's members
Returns a comma delimited string of the email addresses of all users who are members of this group.
AddMember adds a principal to this group. It takes a single principal id. Returns a two value array. the first value is true on successful addition or 0 on failure. The second value is a textual status msg.
Takes an RT::Principal object or its id returns a GroupMember Id if that user is a member of this group. Returns undef if the user isn't a member of the group or if the current user doesn't have permission to find out. Arguably, it should differentiate between ACL failure and non membership.
Takes an RT::Principal object or its id and returns true if that user is a member of this group. Returns undef if the user isn't a member of the group or if the current user doesn't have permission to find out. Arguably, it should differentiate between ACL failure and non membership.
Takes the principal id of a current user or group. If the current user has apropriate rights, removes that GroupMember from this group. Returns a two value array. the first value is true on successful addition or 0 on failure. The second value is a textual status msg.
Optionally takes a hash of key value flags, such as RecordTransaction.
Always returns 1; unfortunately, for historical reasons, users have always been able to examine groups they have indirect access to, even if they do not have SeeGroup explicitly.
Returns the principal object for this user. returns an empty RT::Principal if there's no principal object matching this user. The response is cached. PrincipalObj should never ever change.
Returns this user's PrincipalId
Jesse Vincent, jesse@bestpractical.com
RT
Returns the current value of id. (In the database, id is stored as int(11).)
Returns the current value of Name. (In the database, Name is stored as varchar(200).)
Set Name to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Name will be stored as a varchar(200).)
Returns the current value of Description. (In the database, Description is stored as varchar(255).)
Set Description to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Description will be stored as a varchar(255).)
Returns the current value of Domain. (In the database, Domain is stored as varchar(64).)
Set Domain to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Domain will be stored as a varchar(64).)
Returns the current value of Type. (In the database, Type is stored as varchar(64).)
Deprecated, use Name instead, will be removed in 4.4.
Set Type to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Type will be stored as a varchar(64).)
Deprecated, use SetName instead, will be removed in 4.4.
Returns the current value of Instance. (In the database, Instance is stored as int(11).)
Set Instance to VALUE. Returns (1, 'Status message') on success and (0, 'Error Message') on failure. (In the database, Instance will be stored as a int(11).)
Returns the current value of Creator. (In the database, Creator is stored as int(11).)
Returns the current value of Created. (In the database, Created is stored as datetime.)
Returns the current value of LastUpdatedBy. (In the database, LastUpdatedBy is stored as int(11).)
Returns the current value of LastUpdated. (In the database, LastUpdated is stored as datetime.)
← Back to index