get() public method

Get a permission from repository
public get ( string $name, string $siteKey = 'default' ) : Permission | null
$name string permission name
$siteKey string site key name
return Permission | null
Exemplo n.º 1
0
 public function editPermissions(PermissionHandler $permissionHandler)
 {
     /** @var SettingsHandler $settingsHandler */
     $settingsHandler = app('xe.settings');
     $permissionGroups = $settingsHandler->getPermissionList();
     foreach ($permissionGroups as $tab => &$group) {
         foreach ($group as $key => &$item) {
             $permission = $permissionHandler->get('settings.' . $item['id']);
             if ($permission === null) {
                 $permission = $permissionHandler->register('settings.' . $item['id'], new Grant());
             }
             $item['id'] = 'settings.' . $item['id'];
             $item['permission'] = $permission;
         }
     }
     return \XePresenter::make('settings.permissions', compact('permissionGroups'));
 }
Exemplo n.º 2
0
 /**
  * Get a permission
  *
  * @param string $name    permission name
  * @param string $siteKey site key name
  * @return Permission|null
  */
 protected function get($name, $siteKey = 'default')
 {
     return $this->perm->get($name, $siteKey);
 }
 /**
  * 게시판 기본 권한 반환
  *
  * @return \Xpressengine\Permission\Permission
  */
 public function getGlobal()
 {
     $permission = $this->permissionHandler->get($this->prefix);
     return $permission;
 }