Public Member Functions | |
__construct () | |
loadAclResources (Mage_Admin_Model_Acl $acl, $resource=null, $parentName=null) | |
getAclAssert ($name='') | |
getAclPrivilegeSet ($name='') |
Definition at line 35 of file Config.php.
__construct | ( | ) |
Definition at line 37 of file Config.php.
00038 { 00039 parent::__construct(); 00040 #$this->_elementClass = 'Mage_Core_Model_Config_Element'; 00041 #$this->loadFile(Mage::getModuleDir('etc', 'Mage_Admin').DS.'admin.xml'); 00042 }
getAclAssert | ( | $ | name = '' |
) |
Get acl assert config
string | $name |
Definition at line 90 of file Config.php.
00091 { 00092 $asserts = $this->getNode("admin/acl/asserts"); 00093 if (''===$name) { 00094 return $asserts; 00095 } 00096 00097 if (isset($asserts->$name)) { 00098 return $asserts->$name; 00099 } 00100 00101 return false; 00102 }
getAclPrivilegeSet | ( | $ | name = '' |
) |
Retrieve privilege set by name
string | $name |
Definition at line 110 of file Config.php.
00111 { 00112 $sets = $this->getNode("admin/acl/privilegeSets"); 00113 if (''===$name) { 00114 return $sets; 00115 } 00116 00117 if (isset($sets->$name)) { 00118 return $sets->$name; 00119 } 00120 00121 return false; 00122 }
loadAclResources | ( | Mage_Admin_Model_Acl $ | acl, | |
$ | resource = null , |
|||
$ | parentName = null | |||
) |
Load Acl resources from config
Mage_Admin_Model_Acl | $acl | |
Mage_Core_Model_Config_Element | $resource | |
string | $parentName |
Definition at line 52 of file Config.php.
00053 { 00054 if (is_null($resource)) { 00055 $resource = Mage::getConfig()->getNode("adminhtml/acl/resources"); 00056 $resourceName = null; 00057 } else { 00058 $resourceName = (is_null($parentName) ? '' : $parentName.'/').$resource->getName(); 00059 $acl->add(Mage::getModel('admin/acl_resource', $resourceName), $parentName); 00060 } 00061 00062 if (isset($resource->all)) { 00063 $acl->add(Mage::getModel('admin/acl_resource', 'all'), null); 00064 } 00065 00066 if (isset($resource->admin)) { 00067 $children = $resource->admin; 00068 } elseif (isset($resource->children)){ 00069 $children = $resource->children->children(); 00070 } 00071 00072 00073 00074 if (empty($children)) { 00075 return $this; 00076 } 00077 00078 foreach ($children as $res) { 00079 $this->loadAclResources($acl, $res, $resourceName); 00080 } 00081 return $this; 00082 }