- NAME
- METHODS
  - Create PARAMHASH
  - CurrentUserCanSee
  - Load
  - SetName
  - ValidateName
  - Delete
  - DecodedContent
  - SetContent
  - ValidateContent
- PRIVATE METHODS
  - _Create
  - _Set
  - _Value

# NAME

RT::Configuration - Represents a config setting

# METHODS

## Create PARAMHASH

Create takes a hash of values and creates a row in the database. Available keys are:

Name

  Must be unique.

Content

  If you provide a reference, we will automatically serialize the data structure using Data::Dumper. Otherwise any string is passed through as-is.

ContentType

  Currently handles `perl` or `application/json`.

Returns a tuple of (status, msg) on failure and (id, msg) on success. Also automatically propagates this config change to all server processes.

## CurrentUserCanSee

Returns true if the current user can see the database setting

## Load

Load a setting from the database. Takes a single argument. If the argument is numerical, load by the column 'id'. Otherwise, load by the "Name" column.

## SetName

Not permitted

## ValidateName

Returns either (0, "failure reason") or 1 depending on whether the given name is valid.

## Delete

Checks ACL, and on success propagates this config change to all server processes.

## DecodedContent

Returns a pair of this setting's content and any error.

## SetContent

## ValidateContent

Returns either (0, "failure reason") or 1 depending on whether the given content is valid.

# PRIVATE METHODS

Documented for internal use only, do not call these from outside RT::Configuration itself.

## _Create

Checks that the field being created/updated is not immutable, before calling `SUPER::Create` to save changes in a new row, returning id of new row on success and 0, and message on failure.

## _Set

Checks if the current user has SuperUser before calling `SUPER::_Set`, and then propagates this config change to all server processes.

## _Value

Checks "CurrentUserCanSee" before calling `SUPER::_Value`.

← Back to index