コード例 #1
0
 /**
  * Verify the user have access to the manage layout.
  */
 public function checkGroupAccess()
 {
     if (parent::checkGroupAccess()) {
         return TRUE;
     }
     $account = $this->getAccount();
     if (!spaces_access_admin($account, $this->space)) {
         // The current user can't manage boxes.
         $this->throwException("You can't manage layout in this vsite.");
     }
     return true;
 }
コード例 #2
0
 /**
  * Verify the user have access to the manage boxes.
  */
 public function checkGroupAccess()
 {
     if (parent::checkGroupAccess()) {
         return TRUE;
     }
     $account = $this->getAccount();
     $access = !og_user_access('node', $this->space->id, 'administer boxes', $account) && !og_user_access('node', $this->space->id, 'edit boxes', $account);
     if ($access) {
         // The current user can't manage boxes.
         $this->throwException("You can't manage boxes in this vsite.");
     }
     return TRUE;
 }
コード例 #3
0
 /**
  * Verify the user have access to the manage layout.
  */
 public function checkGroupAccess()
 {
     parent::checkGroupAccess();
     $account = $this->getAccount();
     if (user_access('administer group', $account)) {
         return TRUE;
     }
     if ($this->group->author->getIdentifier() != $account->uid) {
         // The current user can't manage boxes.
         $this->throwException('You are not authorised to manage the variables of the group.');
     }
     return true;
 }