123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
-
- namespace SCF\Core;
-
- class AclManager {
-
- /**
- * @var mixed
- */
- private $_db;
-
- /**
- * @var
- */
- private $_userGroup;
-
- /**
- * @var
- */
- private $_acl;
-
- /**
- * AclManager constructor.
- * @param Database $db
- * @param $userGroupId
- */
- public function __construct(Database $db, $userGroupId)
- {
- $this->_db = $db;
- $this->_userGroup = $userGroupId;
- $this->getAcl();
- }
-
- /**
- *
- */
- private function getAcl()
- {
- $this->_db->query("SELECT * FROM system_usergroups WHERE guid = :groupId LIMIT 0,1");
- $this->_db->bind(':groupId', $this->_userGroup);
- $this->_acl = $this->_db->single();
- }
-
- /**
- * @param $value
- * @return string
- */
- public function acl($value)
- {
- if(isset($this->_acl[$value])) {
- return $this->_acl[$value];
- }
- else {
- return 'N/A';
- }
- }
- }
|