/** * 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; }
/** * 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; }
/** * Don't show all the variables but only the one who passed in the address. */ public function getSpace() { if (empty($this->path)) { $this->throwException('You must provide the id of the variable.'); } return parent::getSpace(); }