Page MenuHomePhabricator

final class PhabricatorPolicy
Phabricator Technical Documentation (Policy)

This class is not documented.

Tasks

Configuring Storage

Other Methods

Methods

public static function pushStorageNamespace($namespace)
Inherited

This method is not documented.
Parameters
$namespace
Return
wild

public static function popStorageNamespace()
Inherited

This method is not documented.
Return
wild

public static function getDefaultStorageNamespace()
Inherited

This method is not documented.
Return
wild

public static function getStorageNamespace()
Inherited

This method is not documented.
Return
wild

public function setForcedStorageNamespace($namespace)
Inherited

This method is not documented.
Parameters
$namespace
Return
wild

protected function establishLiveConnection($mode)
Inherited

This method is not documented.
Parameters
$mode
Return
wild

private function newClusterConnection($application, $database, $mode)
Inherited

This method is not documented.
Parameters
$application
$database
$mode
Return
wild

private function raiseImproperWrite($database)
Inherited

This method is not documented.
Parameters
$database
Return
wild

private function raiseImpossibleWrite($database)
Inherited

This method is not documented.
Parameters
$database
Return
wild

private function raiseUnconfigured($database)
Inherited

This method is not documented.
Parameters
$database
Return
wild

private function raiseUnreachable($database, $proxy)
Inherited

This method is not documented.
Parameters
$database
Exception$proxy
Return
wild

public function getTableName()
Inherited

This method is not documented.
Return
wild

public function getApplicationName()
Inherited

This method is not documented.
Return
wild

protected function getDatabaseName()
Inherited

This method is not documented.
Return
wild

public static function chunkSQL($fragments, $limit)
Inherited

PhabricatorLiskDAO

Break a list of escaped SQL statement fragments (e.g., VALUES lists for INSERT, previously built with qsprintf()) into chunks which will fit under the MySQL 'max_allowed_packet' limit.

If a statement is too large to fit within the limit, it is broken into its own chunk (but might fail when the query executes).

Parameters
array$fragments
$limit
Return
wild

protected function assertAttached($property)
Inherited

This method is not documented.
Parameters
$property
Return
wild

protected function assertAttachedKey($value, $key)
Inherited

This method is not documented.
Parameters
$value
$key
Return
wild

protected function detectEncodingForStorage($string)
Inherited

This method is not documented.
Parameters
$string
Return
wild

protected function getUTF8StringFromStorage($string, $encoding)
Inherited

This method is not documented.
Parameters
$string
$encoding
Return
wild

protected function willReadData(&$data)
Inherited

This method is not documented.
Parameters
array&$data
Return
wild

protected function willWriteData(&$data)
Inherited

This method is not documented.
Parameters
array&$data
Return
wild

protected function getConfiguration()

This method is not documented.
Return
wild

public function generatePHID()

This method is not documented.
Return
wild

public static function newFromPolicyAndHandle($policy_identifier, $handle)

This method is not documented.
Parameters
$policy_identifier
PhabricatorObjectHandle$handle
Return
wild

public function setType($type)

This method is not documented.
Parameters
$type
Return
wild

public function getType()

This method is not documented.
Return
wild

public function setName($name)

This method is not documented.
Parameters
$name
Return
wild

public function getName()

This method is not documented.
Return
wild

public function setShortName($short_name)

This method is not documented.
Parameters
$short_name
Return
wild

public function getShortName()

This method is not documented.
Return
wild

public function setHref($href)

This method is not documented.
Parameters
$href
Return
wild

public function getHref()

This method is not documented.
Return
wild

public function setWorkflow($workflow)

This method is not documented.
Parameters
$workflow
Return
wild

public function getWorkflow()

This method is not documented.
Return
wild

public function setIcon($icon)

This method is not documented.
Parameters
$icon
Return
wild

public function getIcon()

This method is not documented.
Return
wild

public function getSortKey()

This method is not documented.
Return
wild

private function getSortName()

This method is not documented.
Return
wild

public static function getPolicyExplanation($viewer, $policy)

This method is not documented.
Parameters
PhabricatorUser$viewer
$policy
Return
wild

public static function getOpaquePolicyExplanation($viewer, $policy)

This method is not documented.
Parameters
PhabricatorUser$viewer
$policy
Return
wild

public function getFullName()

This method is not documented.
Return
wild

public function newRef($viewer)

This method is not documented.
Parameters
PhabricatorUser$viewer
Return
wild

public function isProjectPolicy()

This method is not documented.
Return
wild

public function isCustomPolicy()

This method is not documented.
Return
wild

public function isMaskedPolicy()

This method is not documented.
Return
wild

public function getCustomRuleClasses()

Return a list of custom rule classes (concrete subclasses of PhabricatorPolicyRule) this policy uses.

Return
list<string>List of class names.

public function getCustomRuleValues($rule_class)

Return a list of all values used by a given rule class to implement this policy. This is used to bulk load data (like project memberships) in order to apply policy filters efficiently.

Parameters
string$rule_classPolicy rule classname.
Return
list<wild>List of values used in this policy.

public function attachRuleObjects($objects)

This method is not documented.
Parameters
array$objects
Return
wild

public function getRuleObjects()

This method is not documented.
Return
wild

public function isStrongerThan($other)

Return true if this policy is stronger (more restrictive) than some other policy.

Because policies are complicated, determining which policies are "stronger" is not trivial. This method uses a very coarse working definition of policy strength which is cheap to compute, unambiguous, and intuitive in the common cases.

This method returns true if the class of this policy is stronger than the other policy, even if the policies are (or might be) the same in practice. For example, "Members of Project X" is considered a stronger policy than "All Users", even though "Project X" might (in some rare cases) contain every user.

Generally, the ordering here is:

  • Public
  • All Users
  • (Everything Else)
  • No One

In the "everything else" bucket, we can't make any broad claims about which policy is stronger (and we especially can't make those claims cheaply).

Even if we fully evaluated each policy, the two policies might be "Members of X" and "Members of Y", each of which permits access to some set of unique users. In this case, neither is strictly stronger than the other.

Parameters
PhabricatorPolicy$otherOther policy.
Return
bool`true` if this policy is more restrictive than the other policy.

public function isValidPolicyForEdit()

This method is not documented.
Return
wild

public static function getSpecialRules($object, $viewer, $capability, $active_only)

This method is not documented.
Parameters
PhabricatorPolicyInterface$object
PhabricatorUser$viewer
$capability
$active_only
Return
wild

public function getCapabilities()

This method is not documented.
Return
wild

public function getPolicy($capability)

This method is not documented.
Parameters
$capability
Return
wild

public function hasAutomaticCapability($capability, $viewer)

This method is not documented.
Parameters
$capability
PhabricatorUser$viewer
Return
wild

public function destroyObjectPermanently($engine)

This method is not documented.
Parameters
PhabricatorDestructionEngine$engine
Return
wild