RT 5.0.1 Documentation
RT::SharedSetting
NAME
RT::SharedSetting - an API for settings that belong to an RT::User or RT::Group
SYNOPSIS
use RT::SharedSetting;
DESCRIPTION
A RT::SharedSetting is an object that can belong to an RT::User or an <RT::Group>. It consists of an ID, a name, and some arbitrary data.
METHODS
new
Returns a new RT::SharedSetting object. Takes the current user, see also RT::Base.
Load
Takes a privacy specification and a shared-setting ID. Loads the given object ID if it belongs to the stated user or group. Calls the "PostLoad" method on success for any further initialization. Returns a tuple of status and message, where status is true on success.
LoadById
First loads up the RT::Attribute for this shared setting by ID, then calls "Load" with the correct parameters. Returns a tuple of status and message, where status is true on success.
PostLoad
Called after a successful "Load".
PostLoadValidate
Called just before returning success from "Load"; may be used to validate that the record is correct. This method is expected to return a (ok, msg) pair.
Save
Creates a new shared setting. Takes a privacy, a name, and any other arguments. Saves the given parameters to the appropriate user/group object, and loads the resulting object. Arguments are passed to the "SaveAttribute" method, which does the actual update. Returns a tuple of status and message, where status is true on success. Defaults are:
Privacy: CurrentUser only
Name: "new (ObjectName)"
SaveAttribute
An empty method for subclassing. Called from "Save" method.
Update
Updates the parameters of an existing shared setting. Any arguments are passed to the "UpdateAttribute" method. Returns a tuple of status and message, where status is true on success.
UpdateAttribute
An empty method for subclassing. Called from "Update" method.
Delete
Deletes the existing shared setting. Returns a tuple of status and message, where status is true upon success.
Name
Returns the name of this shared setting.
Id
Returns the numerical ID of this shared setting.
Privacy
Returns the principal object to whom this shared setting belongs, in a string "<class>-<id>", e.g. "RT::Group-16".
GetParameter
Returns the given named parameter of the setting.
IsVisibleTo Privacy
Returns true if the setting is visible to all principals of the given privacy. This does not deal with ACLs, this only looks at membership.
ColumnMapClassName
Equivalent to "ColumnMapClassName" in RT::Record
ObjectsForLoading
Returns a list of objects that can be used to load this shared setting. It is ACL checked.
ObjectsForCreating
Returns a list of objects that can be used to create this shared setting. It is ACL checked.
ObjectsForModifying
Returns a list of objects that can be used to modify this shared setting. It is ACL checked.
← Back to index