Mage_Admin_Model_Config Class Reference

Inheritance diagram for Mage_Admin_Model_Config:

Varien_Simplexml_Config

List of all members.

Public Member Functions

 __construct ()
 loadAclResources (Mage_Admin_Model_Acl $acl, $resource=null, $parentName=null)
 getAclAssert ($name='')
 getAclPrivilegeSet ($name='')


Detailed Description

Definition at line 35 of file Config.php.


Constructor & Destructor Documentation

__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     }


Member Function Documentation

getAclAssert ( name = ''  ) 

Get acl assert config

Parameters:
string $name
Returns:
Mage_Core_Model_Config_Element|boolean

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

Parameters:
string $name
Returns:
Mage_Core_Model_Config_Element|boolean

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

Parameters:
Mage_Admin_Model_Acl $acl
Mage_Core_Model_Config_Element $resource
string $parentName
Returns:
Mage_Admin_Model_Config

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     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:22:41 2009 for Magento by  doxygen 1.5.8