Permission Class Reference

Inheritance diagram for Permission:
OwnedModel RedBeanModel BeanModel ObservableComponent

Public Member Functions

 __toString ()
 getEffectivePermissions (Permitable $permitable)
 getExplicitPermissions (Permitable $permitable)
 getInheritedPermissions (Permitable $permitable)
 castDownPermitable ()
 __get ($attributeName)
 __set ($attributeName, $value)

Static Public Member Functions

static removeForPermitable (Permitable $permitable)
static deleteAll ()
static permissionsToString ($permissions)
static getDefaultMetadata ()
static isTypeDeletable ()
static resetCaches ()

Data Fields

const ALLOW = 0x1
const DENY = 0x2
const ALLOW_DENY = 0x3
const NONE = 0x00
const READ = 0x01
const WRITE = 0x02
const DELETE = 0x04
const CHANGE_PERMISSIONS = 0x08
const CHANGE_OWNER = 0x10
const ALL = 0x1F
const READ_WRITE = 0x03
const READ_DELETE = 0x05
const READ_WRITE_DELETE = 0x07
const READ_WRITE_CHANGE_PERMISSIONS = 0xB
const READ_WRITE_CHANGE_PERMISSIONS_CHANGE_OWNER = 0x1B

Protected Member Functions

 constructDerived ($bean, $setDefaults)

Static Protected Attributes

static $cachedCastedDownPermitables = array()

Detailed Description

Definition at line 37 of file Permission.php.


Member Function Documentation

static deleteAll (  )  [static]

Delete all models

Reimplemented from RedBeanModel.

Definition at line 85 of file Permission.php.

__toString (  ) 

Returns the displayable string for the class. Should be overridden in any model that can provide a meaningful string representation of itself.

Returns:
A string.

Reimplemented from RedBeanModel.

Definition at line 103 of file Permission.php.

castDownPermitable (  ) 

See comments on RedBeanModel::castDown() and RedBeanModel::testDownCast() to see why this (apparent/actual dodginess) is needed.

Attempts to get from local php cache first.

Definition at line 192 of file Permission.php.

__get ( attributeName  ) 

Exposes the members and relations of the model as if they were actual attributes of the model. See __set().

Parameters:
$attributeName A non-empty string that is the name of a member or relation.
See also:
attributeNames()
Returns:
A value or model of the type specified as valid for the member or relation by the meta data supplied by the extending class's getMetadata() method.

Reimplemented from RedBeanModel.

Definition at line 214 of file Permission.php.

__set ( attributeName,
value 
)

Sets the members and relations of the model as if they were actual attributes of the model. For example, if Account extends RedBeanModel and its attributeNames() returns that one it has a member 'name' and a relation 'owner' they are simply accessed as:

   $account = new Account();
   $account->name = 'International Corp';
   $account->owner = User::getByUsername('bill');
   $account->save();
Parameters:
$attributeName A non-empty string that is the name of a member or relation of the model.
$value A value or model of the type specified as valid for the member or relation by the meta data supplied by the extending class's getMetadata() method.

Reimplemented from OwnedModel.

Definition at line 229 of file Permission.php.

static getDefaultMetadata (  )  [static]

Returns the default meta data for the class. It must be appended to the meta data from the parent model, if any.

Reimplemented from RedBeanModel.

Definition at line 236 of file Permission.php.

static isTypeDeletable (  )  [static]

To be overriden on intermediate derived classes to return false so that deletes are not done on intermediate classes because the object relational mapping will not clean up properly. For example if User is a Person, and Person is a RedBeanModel delete should be called only on User, not on Person. So User must override isDeletable to return false.

Reimplemented from OwnedModel.

Definition at line 261 of file Permission.php.


The documentation for this class was generated from the following file:
 All Data Structures Functions Variables
Generated on Mon Sep 25 07:10:28 2017