Пример #1
0
 /**
  * @param  \Cms\Data\Group $group
  * @return boolean
  */
 private function hasGroupAllPagesRights(\Cms\Data\Group $group)
 {
     $groupRights = $group->getRights();
     if ($groupRights === \Cms\Dao\Group::DEFAULT_EMPTY_RIGHTS) {
         return false;
     }
     $groupRightsAsArray = json_decode($groupRights, true);
     if (!is_array($groupRightsAsArray)) {
         return false;
     }
     foreach ($groupRightsAsArray as $groupRightsArray) {
         if (isset($groupRightsArray['area']) && $groupRightsArray['area'] === 'pages' && $groupRightsArray['privilege'] === 'all') {
             return true;
         }
     }
     return false;
 }
Пример #2
0
 /**
  * @param $data
  */
 protected function setValuesFromData(GroupData $data)
 {
     $this->setId($data->getId());
     $this->setWebsiteId($data->getWebsiteId());
     $this->setName($data->getName());
     $this->setRights($data->getRights());
     $this->setUsers($data->getUsers());
 }