Class Permissions
	
	
Permissions management
Controls which options are available for setting the Access Control List's
Control Objects as well as offers an interface for interacting with the ACL
	 
	
		- 
			Model
			
			
			
		
- 
			 AppModel AppModel
- 
			 Permissions Permissions
Methods summary
		
		
			| 
				 public 
				
				
				 | 
			#
			__construct( )
				
Loads the ACL for processing 
				
Loads the ACL for processing Overrides | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			get( integer $id )
				
Fetches the given permission record from the database by ID 
				
Fetches the given permission record from the database by ID Parameters
						$idinteger$id The permission ID to fetch
Returns
						mixedA stdClass object representing a permission field, false if the permission field
does not exist
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getByAlias( string $alias, integer $plugin_id = null, string $action = null )
				
Fetches the given permission record from the database by alias 
				
Fetches the given permission record from the database by alias Parameters
						$aliasstring$alias The permission alias to fetch
$plugin_idinteger$plugin_id The ID of the plugin (null if not part of a plugin) the alias belongs
to
$actionstring$action The permission action to fetch (null fetches 1st match on alias)
Returns
						mixedA stdClass object representing a permission field, false if the permission field
does not exist
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getGroup( integer $group_id )
				
Fetches the given permission group record from the database by ID 
				
Fetches the given permission group record from the database by ID Parameters
						$group_idinteger$group_id The permission group ID to fetch
Returns
						mixedA stdClass object representing a permission group, false if the permission group
does not exist
 
 | 
		
			| 
				 public 
				mixed
				
				 | 
			#
			getGroupByAlias( string $group_alias, integer $plugin_id = null )
				
Fetches the given permission group record from the database by alias 
				
Fetches the given permission group record from the database by alias Parameters
						$group_aliasstring$group_alias The permission group alias to fetch
$plugin_idinteger$plugin_id The ID of the plugin (null if not part of a plugin) the alias belongs
to
Returns
						mixedA stdClass object representing a permission group, false if the permission group
does not exist
 
 | 
		
			| 
				 public 
				array
				
				 | 
			#
			getAll( string $level, integer $company_id )
				
Fetches all permission fields divided under each permission category. 
				
Fetches all permission fields divided under each permission category. Parameters
						$levelstring$level The level to fetch permissions for ('staff', or 'client')
$company_idinteger$company_id The company to fetch permissions for
Returns
						arrayAn array of stdClass objects each representing a permission group. Each
permission group also contains an array of permission fields representing as
stdClass objects
 
 | 
		
			| 
				 public 
				stdClass | 
			#
			fromAcl( string $aro, string $level, integer $company_id )
				
Fetches a set of permission groups and permission fields that the given group
has access to on the provided level and company 
				
Fetches a set of permission groups and permission fields that the given group
has access to on the provided level and company Parameters
						$arostring$aro The ARO to fetch permissions for
$levelstring$level The level to fetch permissions for ('staff' or 'client')
$company_idinteger$company_id The ID of the company to fetch permissions for
Returns
						stdClassA stdClass object containing the following: - permission_group An numerically
indexed array of permission group IDs that this ARO is allowed to access -
permission A numerically indexed array of permission field IDs that this ARO is
allowed to access
					 | 
		
			| 
				 public 
				boolean
				
				 | 
			#
			authorized( string $aro, string $aco, mixed $action, mixed $level, mixed $company_id )
				
Verifies whether the given ARO is authorized to access the given ACO on the
given action 
				
Verifies whether the given ARO is authorized to access the given ACO on the
given action Parameters
						$arostring$aro The ARO to verify can access the ACO
$acostring$aco The ACO to verify can be accessed by the ARO
$action$level$company_idReturns
						booleanTrue if the ARO is authorized to access the ACO or if the permission or
permission group does not exist, false otherwise
 
 | 
		
			| 
				 public 
				integer
				
				 | 
			#
			add( array $vars )
				
Adds a new permission field to the system (also adds the permission to the
ACL) 
				
Adds a new permission field to the system (also adds the permission to the
ACL) Parameters
						$varsarray$vars An array of input fields including: - group_id The ID of the permission
group this permission belongs to - name The name of this permission (language
definition or plain-text) - alias The ACO alias for this permission (i.e. the
Class name to apply to) - action The action this ACO may control (i.e. the
Method name of the alias to control access for) - plugin_id The ID of the plugin
this action belongs to (if any)
Returns
						integerThe ID of the permission record on success, void one error
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			edit( integer $id, array $vars )
				
Updates the permission field in the system (also adds the permission to the
ACL if needed) 
				
Updates the permission field in the system (also adds the permission to the
ACL if needed) Parameters
						$idinteger$id The ID of the permission field to update
$varsarray$vars An array of input fields including: - group_id The ID of the permission
group this permission belongs to - name The name of this permission (language
definition or plain-text) - alias The ACO alias for this permission (i.e. the
Class name to apply to) - action The action this ACO may control (i.e. the
Method name of the alias to control access for) - plugin_id The ID of the plugin
this action belongs to (if any)
 | 
		
			| 
				 public 
				
				
				 | 
			#
			delete( integer $id )
				
Deletes the permission field from the system, also removes the items from the
ACL 
				
Deletes the permission field from the system, also removes the items from the
ACL Parameters
						$idinteger$id The ID of the permission field to delete
 | 
		
			| 
				 public 
				integer
				
				 | 
			#
			addGroup( array $vars )
				
Adds a new permission group to the system (also adds the permission to the
ACL) 
				
Adds a new permission group to the system (also adds the permission to the
ACL) Parameters
						$varsarray$vars An array of input fields including: - name The name of this permission
group (language definition or plain-text) - level The level this permission
group resides on (staff or client) - alias The ACO alias for this permission
group (i.e. the Class name to apply to) - plugin_id The ID of the plugin this
permission group belongs to (if any)
Returns
						integerThe ID of the permission group on success, void one error
 
 | 
		
			| 
				 public 
				
				
				 | 
			#
			editGroup( integer $group_id, array $vars )
				
Updates the permission group in the system (also adds the permission to the
ACL if needed) 
				
Updates the permission group in the system (also adds the permission to the
ACL if needed) Parameters
						$group_idinteger$id The ID of the permission group to update
$varsarray$vars An array of input fields including: - name The name of this permission
group (language definition or plain-text) - level The level this permission
group resides on (staff or client) - alias The ACO alias for this permission
group (i.e. the Class name to apply to) - plugin_id The ID of the plugin this
permission group belongs to (if any)
 | 
		
			| 
				 public 
				
				
				 | 
			#
			deleteGroup( integer $group_id )
				
Deletes the permission group from the system, also removes the items from the
ACL 
				
Deletes the permission group from the system, also removes the items from the
ACL Parameters
						$group_idinteger$group_id The ID of the permission group to delete
 | 
		
		Methods inherited from AppModel
		
			_(), 
			boolToInt(), 
			currencyToDecimal(), 
			dateToUtc(), 
			errors(), 
			getPerPage(), 
			ifSet(), 
			loadCrypto(), 
			setDefaultIfEmpty(), 
			setPerPage(), 
			setRulesIfSet(), 
			strToBool(), 
			systemDecrypt(), 
			systemEncrypt(), 
			systemHash(), 
			truncateDecimal(), 
			validateExists(), 
			validateStateCountry()
		
		Methods inherited from Model
		
			affectedRows(), 
			begin(), 
			commit(), 
			getConnection(), 
			lastInsertId(), 
			makeDSN(), 
			prepare(), 
			query(), 
			rollBack(), 
			setAttribute(), 
			setFetchMode()
		
		Magic methods summary
		Properties summary
		Properties inherited from AppModel
		
			$replacement_keys