get_id()
Returns the drivers unique id. This can be used to identify the driver, or to select a specific driver instance.
Static | No |
---|---|
Parameters | None |
Returns | The drivers id string. |
Example |
|
The Auth package provides a standardized interface for authentication in Fuel. This allows our users to write their own drivers and easily integrate a new driver to work with old code by keeping the basic methods consistent.
This driver is the base class for all Auth acl drivers. It is defined as an abstract class which contains all methods generic to all acl drivers, and abstract method definitions for all methods any acl driver MUST implement.
For ease of use, the has_access() method is exposed through the generic Auth static interface.
Using the static interface, you can do
// returns true if the current user has the required permissions
$may_access_comments = Auth::has_access('comments[read,write]');
Generic methods are defined in the acl base driver, and are available to all Auth acl drivers through extension. These methods provide functions to interact with specific acls, and to check for access.
The methods defined in the classes but not documented here are used internally, and should not be called directly.
Returns the drivers unique id. This can be used to identify the driver, or to select a specific driver instance.
Static | No |
---|---|
Parameters | None |
Returns | The drivers id string. |
Example |
|
Sets a driver configuration value.
Static | No | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
|||||||||
Returns | void | |||||||||
Example |
|
Gets a driver configuration value.
Static | No | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
|||||||||
Returns | mixed | |||||||||
Example |
|
Every acl driver you develop MUST provide all of these methods, and the MUST return the values documented here.
The has_access method uses the defined ACL drivers to check the users access according to the given condition.
Static | No | |||||||||
---|---|---|---|---|---|---|---|---|---|---|
Parameters |
|
|||||||||
Returns | boolean, true if access was granted, false if not. | |||||||||
Example |
|