/** * Unassigns a permission to the role. * * @param int|string $permission Permission identifier number or string. * @return boolean True if the permission has been successfully unassigned or if it has been already unassigned. */ public function unassignPermission($permission) { if (!is_int($this->id)) { return false; } // If the permission has been given by name, get its id if (!is_int($permission)) { $permission = Permission::getIdFromName($permission); if ($permission === false) { return false; } } return $this->dataAccess->execute("DELETE FROM domain_roles_permissions\n WHERE roleid={$this->id} AND permissionid={$permission}"); }
public function doUpdateDomainAction($domainid, $params) { $permission = new \Innomatic\Domain\User\Permission(\Innomatic\Domain\User\Permission::getIdFromName($params['name'])); return $permission->setTitle($params['title'])->setDescription($params['description'])->setCatalog($params['catalog'])->setApplication($this->appname)->store(); }