public static function mustRetainCapability($user, $object, $capability)
public static function mustRetainCapability($user, $object, $capability)
Parameters
PhabricatorUser | $user | |
PhabricatorPolicyInterface | $object | |
$capability |
Return
wild |
public static function requireCapability($user, $object, $capability)
public static function requireCapability($user, $object, $capability)
Parameters
PhabricatorUser | $user | |
PhabricatorPolicyInterface | $object | |
$capability |
Return
wild |
public static function requireCapabilityWithForcedPolicy($viewer, $object, $capability, $forced_policy)
public static function requireCapabilityWithForcedPolicy($viewer, $object, $capability, $forced_policy)
Perform a capability check, acting as though an object had a specific policy. This is primarily used to check if a policy is valid (for example, to prevent users from editing away their ability to edit an object).
Specifically, a check like this:
PhabricatorPolicyFilter::requireCapabilityWithForcedPolicy( $viewer, $object, PhabricatorPolicyCapability::CAN_EDIT, $potential_new_policy);
...will throw a PhabricatorPolicyException if the new policy would remove the user's ability to edit the object.
Parameters
PhabricatorUser | $viewer | The viewer to perform a policy check for. |
PhabricatorPolicyInterface | $object | The object to perform a policy check on. |
string | $capability | Capability to test. |
string | $forced_policy | Perform the test as though the object has this policy instead of the policy it actually has. |
Return
void |
public static function hasCapability($user, $object, $capability)
public static function hasCapability($user, $object, $capability)
Parameters
PhabricatorUser | $user | |
PhabricatorPolicyInterface | $object | |
$capability |
Return
wild |
public static function canInteract($user, $object)
public static function canInteract($user, $object)
Parameters
PhabricatorUser | $user | |
PhabricatorPolicyInterface | $object |
Return
wild |
public static function requireCanInteract($user, $object)
public static function requireCanInteract($user, $object)
Parameters
PhabricatorUser | $user | |
PhabricatorPolicyInterface | $object |
Return
wild |
private static function getRequiredInteractCapabilities($object)
private static function getRequiredInteractCapabilities($object)
Parameters
PhabricatorPolicyInterface | $object |
Return
wild |
public function setViewer($user)
public function setViewer($user)
Parameters
PhabricatorUser | $user |
Return
wild |
public function requireCapabilities($capabilities)
public function requireCapabilities($capabilities)
Parameters
array | $capabilities |
Return
wild |
public function raisePolicyExceptions($raise)
public function raisePolicyExceptions($raise)
Parameters
$raise |
Return
wild |
public function forcePolicy($forced_policy)
public function forcePolicy($forced_policy)
Parameters
$forced_policy |
Return
wild |
public function apply($objects)
public function apply($objects)
Parameters
array | $objects |
Return
wild |
private function applyExtendedPolicyChecks($extended_objects)
private function applyExtendedPolicyChecks($extended_objects)
Parameters
array | $extended_objects |
Return
wild |
private function executeExtendedPolicyChecks($viewer, $capabilities, $objects, $key_map)
private function executeExtendedPolicyChecks($viewer, $capabilities, $objects, $key_map)
Parameters
PhabricatorUser | $viewer | |
array | $capabilities | |
array | $objects | |
array | $key_map |
Return
wild |
private function checkCapability($object, $capability)
private function checkCapability($object, $capability)
Parameters
PhabricatorPolicyInterface | $object | |
$capability |
Return
wild |
public function rejectObject($object, $policy, $capability)
public function rejectObject($object, $policy, $capability)
Parameters
PhabricatorPolicyInterface | $object | |
$policy | ||
$capability |
Return
wild |
private function loadObjectPolicies($map)
private function loadObjectPolicies($map)
Parameters
array | $map |
Return
wild |
private function loadCustomPolicies($map)
private function loadCustomPolicies($map)
Parameters
array | $map |
Return
wild |
private function checkObjectPolicy($policy_phid, $object)
private function checkObjectPolicy($policy_phid, $object)
Parameters
$policy_phid | ||
PhabricatorPolicyInterface | $object |
Return
wild |
private function checkCustomPolicy($policy_phid, $object)
private function checkCustomPolicy($policy_phid, $object)
Parameters
$policy_phid | ||
PhabricatorPolicyInterface | $object |
Return
wild |
private function getObjectPolicy($object, $capability)
private function getObjectPolicy($object, $capability)
Parameters
PhabricatorPolicyInterface | $object | |
$capability |
Return
wild |
private function renderAccessDenied($object)
private function renderAccessDenied($object)
Parameters
PhabricatorPolicyInterface | $object |
Return
wild |
private function canViewerSeeObjectsInSpace($viewer, $space_phid)
private function canViewerSeeObjectsInSpace($viewer, $space_phid)
Parameters
PhabricatorUser | $viewer | |
$space_phid |
Return
wild |
private function rejectObjectFromSpace($object, $space_phid)
private function rejectObjectFromSpace($object, $space_phid)
Parameters
PhabricatorPolicyInterface | $object | |
$space_phid |
Return
wild |
private function applyApplicationChecks($objects)
private function applyApplicationChecks($objects)
Parameters
array | $objects |
Return
wild |
private function getApplicationForPHID($phid)
private function getApplicationForPHID($phid)
Parameters
$phid |
Return
wild |