Hello,
We have a the following structure for our application
require_once "Zend/Loader.php";
Zend_Loader::registerAutoload();
$acl = new Zend_Acl();
// application
$acl->add(new Zend_Acl_Resource('application1'));
// groups
$acl->add(new Zend_Acl_Resource('group1'), 'application1');
$acl->add(new Zend_Acl_Resource('group2'), 'application1');
// fields
$acl->add(new Zend_Acl_Resource('field1'), 'group1');
$acl->add(new Zend_Acl_Resource('field2'), 'group1');
$acl->add(new Zend_Acl_Resource('field3'), 'group2');
$acl->add(new Zend_Acl_Resource('field4'), 'application1');
// roles
$acl->addRole(new Zend_Acl_Role('applicant'));
$acl->addRole(new Zend_Acl_Role('admin'), 'applicant');
// permissions
$acl->allow('applicant', 'application1', 'view');
$acl->allow('applicant', 'group1', 'edit');
This represents a database of college applications and groups/fields are components of a college application. From the above the applicant does have edit permission to edit field2.
The entire structure is stored as an acl object in a mysql database.
After sometime the admins decide to move the field2 from group1 to group2, how would one go about changing the acl object ?
i checked the file Acl.php but there are no methods wherein one change the parent of a resource and thereby automatically update the rules/permissions.
Thanks.
Shashikant