Overview

Class for reading access privileges from a database table.

0:flag 1:type 2:name 3:class 4:action

Package

This class is part of the Solar_Access package.

Inheritance:

Configuration Keys

  • owner_method: An array of key-value pairs to map object class to a method in that class to determine if a user is the owner of that object. The key is the class name, the value is the method name within that class.

  • sql: How to get the SQL object. If a string, is treated as a Solar_Registry::get() object name. If array, treated as config for a standalone Solar_Sql object.

  • table: Name of the table holding access data.

  • flag_col: Name of the column with privilege flag (the stored value in the column should be like a boolean, such as allow/deny, t/f, T/F, y/n, Y/N, or 0/1).

  • type_col: Name of the column with access type info ('handle' or 'role').

  • name_col: Name of the column with the handle or role name.

  • class_col: Name of the column with the class name.

  • action_col: Name of the column with the action name.

  • order_col: Order the results by this column.

Constants

None.

Public Properties

These are all the public properties in the Solar_Access_Adapter_Sql class.

You can also view the list of all public, protected, and private properties.

$list

The access list for a handle and roles.

Public Methods

These are all the public methods in the Solar_Access_Adapter_Sql class.

You can also view the list of all public, protected, and private methods.

__construct()

Constructor.

__destruct()

Default destructor; does nothing other than provide a safe fallback for calls to parent::__destruct().

dump()

Convenience method for getting a dump the whole object, or one of its properties, or an external variable.

fetch()

Fetches access privileges for a user handle and roles.

isAllowed()

Tells whether or not to allow access to a class/action/process combination.

isOwner()

Checks to see if the current user is the owner of a particular object.

load()

Fetches the access list from the adapter into $this->list.

locale()

Looks up class-specific locale strings based on a key.

reset()

Resets the current access controls to a blank array, along with the $_auth and $_role properties.



Local