| Current Path : /var/www/html/ebilikparlimen1/ebilik/ks_library/SRC/ |
| Current File : /var/www/html/ebilikparlimen1/ebilik/ks_library/SRC/Acl.php |
<?php
class KS_Acl extends Zend_Acl {
/**
* This class extends a standard Zend_ACL for use with a database.
* Written by Michael MistaGee Ziegler
* License: LGPL v2 or above
* The constructor expects a Zend_DB object as parameter.
*
*
* Database structure:
*
* +------------------+ +----------------+ +-------------+ +--------------+
* | Resources | | Access | | Roles | | Inheritance |
* +------------------+ +----------------+ +-------------+ +--------------+
* | *id |<--. | *role_id |------>| *id |<-----| *child_id |
* | parent_id |---'`--| *resource_id N| +-------------+ `--| *parent_id |
* | *privilege N|<------| *privilege N| | order |
* +------------------+ | allow | +--------------+
* +----------------+
*
*
* *field = PRIMARY KEY( field )
* -----> = foreign key constraint
*
* The actual table names should be: acl_resources, acl_access, acl_roles, acl_inheritance.
*
* access.allow is a boolean field, that specifies whether the respective rule is an allow rule or a deny rule (important for inherited access).
*
* The inheritance table stores which Role is to inherit rights from which parent rules. There can
* be multiple parent rules. If a rule inherits rights from more than one parent, the first rule applicable
* will be used to determine whether to allow or deny the access rights in question.
* The order field stores in which order the parents are to be introduced to Zend_ACL, effectively setting
* the order the parent rights are evaluated in.
* Using a relational database for this is strongly advised, as it guarantees data integrity.
*
* If you intend to give each resource a specific name or collect other data about it, you should create
* an extra table storing this data and put a foreign key referencing this into the resources table. Same
* goes for the privileges.
*
*/
public function __construct () {
}
public function hasAllRolesOf ($searchRoles) {
}
public function isAllowed ($roles, $resource, $privilege) {
}
}