Skip to content

Commit

Permalink
Fixed issue #16966: No way to edit role Permission
Browse files Browse the repository at this point in the history
Dev: fix the freeze
  • Loading branch information
Shnoulle committed Jan 12, 2021
1 parent bec30ad commit a0f5c6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions application/models/Permission.php
Expand Up @@ -539,7 +539,7 @@ public function hasPermission($iEntityID, $sEntityName, $sPermission, $sCRUD = '

/* Always return true if you are the owner : this can be done in core plugin ? */
// TODO: give the rights to owner adding line in permissions table, so it will return true with the normal way
if ($iUserID == $this->getEntityOwnerId($iEntityID, $sEntityName) && $sEntityName != 'role') {
if ($iUserID == $this->getEntityOwnerId($iEntityID, $sEntityName)) {
return true;
}

Expand Down Expand Up @@ -764,7 +764,7 @@ public static function getUserRole($iUserID)
protected function getEntityOwnerId($iEntityID, $sEntityName)
{
/* know invalid entity */
if (in_array($sEntityName, array('global','template'))) {
if (in_array($sEntityName, array('global','template','role',))) {

This comment has been minimized.

Copy link
@Shnoulle

Shnoulle Jan 14, 2021

Author Collaborator

I ùmuts rfemove the last , … 

return null;
}
/* allow to get it dynamically from any model */
Expand Down

0 comments on commit a0f5c6f

Please sign in to comment.