Skip to content

Commit

Permalink
#1207 Module - canUpdate - check if user has manage permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
michalcharvat committed Nov 22, 2024
1 parent 7a3ebb8 commit f48a12b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion www/go/core/controller/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,18 @@ private function filterPermissions(Query $query) {
return $query;
}

/**
* @param model\Module $entity
* @return bool
* @throws \Exception
*/
protected function canUpdate(Entity $entity): bool
{
return go()->getAuthState()->isAdmin();
if (go()->getAuthState()->isAdmin()) {
return true;
}

return $entity->getUserRights()->mayManage;
}

protected function canCreate(Entity $entity): bool
Expand Down

0 comments on commit f48a12b

Please sign in to comment.