mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 08:22:17 +00:00
PermissionLib->isEntitled is NOT checking anymore if the HTTP method to access to the
controller method is POST or GET to define what permission type (RW/SUID) is needed
This commit is contained in:
@@ -155,21 +155,19 @@ class PermissionLib
|
||||
// Retrives permission and required access type from the $requiredPermissions array
|
||||
list($permission, $requiredAccessType) = explode(PermissionLib::PERMISSION_SEPARATOR, $permissions[$pCounter]);
|
||||
|
||||
$accessType = null;
|
||||
$accessType = '';
|
||||
|
||||
// Checks if the required access type is compliant with the HTTP method (GET => r, POST => w)
|
||||
if ($requestMethod == self::READ_HTTP_METHOD
|
||||
&& strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false)
|
||||
if (strpos($requiredAccessType, PermissionLib::READ_RIGHT) !== false)
|
||||
{
|
||||
$accessType = PermissionLib::SELECT_RIGHT; // S
|
||||
}
|
||||
elseif ($requestMethod == self::WRITE_HTTP_METHOD
|
||||
&& strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false)
|
||||
if (strpos($requiredAccessType, PermissionLib::WRITE_RIGHT) !== false)
|
||||
{
|
||||
$accessType = PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID
|
||||
$accessType .= PermissionLib::REPLACE_RIGHT.PermissionLib::DELETE_RIGHT; // UID
|
||||
}
|
||||
|
||||
if ($accessType != null) // if compliant
|
||||
if (!isEmptyString($accessType)) // if compliant
|
||||
{
|
||||
// Checks if the user has the same required permissiond with the same required access type
|
||||
$checkPermissions = $this->isBerechtigt($permission, $accessType);
|
||||
|
||||
Reference in New Issue
Block a user