Static Public Member Functions | |
static | can ($what, $uid= '') |
Determines whether user is permitted to execute requested action. | |
static | getAlignments ($url, $mode=TSD::MODE_LIVE) |
Retrieves all alignments for a given CSERD ID or URL. | |
static | getDBI () |
Retrieves the DBI object connected to the CSERD database. | |
static | getLocalDBI () |
Retrieves the DBI object connected to the TSD database. | |
static | getParties () |
Retrieves list of all users who have been granted any permissions. | |
static | log ($description, $query) |
INSERT BRIEF DESCRIPTION HERE. | |
static | setPermission ($uid, $which, $how) |
Modifies permission for user. | |
static | stringToMode ($modeString) |
Converts descriptive name of mode to constant value. | |
Public Attributes | |
Mode constants | |
const | MODE_ALL |
all versions | |
const | MODE_APPROVED |
dev versions that are marked APPROVED | |
const | MODE_CHANGED |
dev versions that are marked CHANGED | |
const | MODE_DELETED |
dev versions that are marked DELETED | |
const | MODE_DEV |
dev versions (of any status) | |
const | MODE_DEV_ACTIVE |
dev versions excluding DELETED | |
const | MODE_DEV_UNAPPROVED |
dev versions excluding APPROVED | |
const | MODE_LIVE |
live versions (always approved) | |
const | MODE_NEW |
dev versions that are marked NEW | |
Status constants | |
const | STATUS_APPROVED |
alignment/relationship that is visible on live site | |
const | STATUS_CHANGED |
alignment/relationship that has been modified | |
const | STATUS_DELETED |
alignment/relationship that has been marked for deletion | |
const | STATUS_NEW |
newly created alignment/relationship | |
Version constants | |
const | VERSION_DEV |
dev version of alignment/relationship | |
const | VERSION_LIVE |
live version of alignment/relationship (status must be TSD::STATUS_APPROVED) |
This class provides TSD initialization functions, permission functions and a few utility functions. It is meant to be a static (singleton) class and cannot be instantiated.
static TSD::can | ( | $ | what, | |
$ | uid = '' | |||
) | [static] |
Determines whether user is permitted to execute requested action.
The available actions are: 'edit', 'approve' and 'align'. These permissions are checked by the API when making TSD-modifying calls, and also by the TSD admin tool. No permissions are checked for reading from the database.
$what | [string]: which of the three available actions listed above is to be checked for | |
$uid | [int]: user ID of the user to check permission for; defaults to current user |
static TSD::getAlignments | ( | $ | url, | |
$ | mode = TSD::MODE_LIVE | |||
) | [static] |
Retrieves all alignments for a given CSERD ID or URL.
You can provide either a URL or an ID. This method just calls getResourceAlignments() on TSDText, TSDStandard and TSDWord for the same URL/ID and concatenates the results. It is thus merely a convenience method.
$url | [mixed]: CSERD URL or CSERD ID | |
$mode | [int]: alignment mode: only retrieve alignments matching this mode (one of the TSD::MODE_* constants) |
static TSD::getDBI | ( | ) | [static] |
static TSD::getLocalDBI | ( | ) | [static] |
static TSD::getParties | ( | ) | [static] |
Retrieves list of all users who have been granted any permissions.
Users who have been denied all permissions are removed from the database, so they will not show up in this list, even if they had permissions before.
static TSD::log | ( | $ | description, | |
$ | query | |||
) | [static] |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
$description | [TYPE]: DESCRIPTION | |
$query | [TYPE]: DESCRIPTION |
static TSD::setPermission | ( | $ | uid, | |
$ | which, | |||
$ | how | |||
) | [static] |
Modifies permission for user.
$uid | [int]: user to change permission for | |
$which | [string]: permission to change; one of: 'edit', 'approve' or 'align' | |
$how | [boolean]: true if granting the permission, false if revoking |
static TSD::stringToMode | ( | $ | modeString | ) | [static] |
Converts descriptive name of mode to constant value.
Rather than have a thousand pieces of code that convert, e.g., 'devUnapproved' to TSD::MODE_DEV_UNAPPROVED, this function is provided for convenience.
$modeString | [string]: string description of mode |