/** * Drop role * * @param void * @return null */ function delete() { if ($this->active_role->isNew()) { $this->httpError(HTTP_ERR_NOT_FOUND); } // if if ($this->request->isSubmitted()) { $delete = $this->active_role->delete(); if ($delete && !is_error($delete)) { clean_permissions_cache(); flash_success("Role ':name' has been deleted", array('name' => $this->active_role->getName())); } else { flash_error("Failed to delete role ':name'", array('name' => $this->active_role->getName())); } // if $this->redirectTo('admin_roles'); } else { $this->httpError(HTTP_ERR_BAD_REQUEST); } // if }
/** * Clear all permissions or caches when project gets updated or removed * * @param Project $project * @return null */ function clean_project_permissions_cache($project) { clean_permissions_cache(); }