mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-07 05:31:22 +00:00
GUAC-1188 Use canReadPermissions() - do not reimplement permission checks.
This commit is contained in:
@@ -151,9 +151,8 @@ public class SystemPermissionService
|
|||||||
public SystemPermission retrievePermission(AuthenticatedUser user,
|
public SystemPermission retrievePermission(AuthenticatedUser user,
|
||||||
ModeledUser targetUser, SystemPermission.Type type) throws GuacamoleException {
|
ModeledUser targetUser, SystemPermission.Type type) throws GuacamoleException {
|
||||||
|
|
||||||
// Only an admin can read permissions that aren't his own
|
// Retrieve permissions only if allowed
|
||||||
if (user.getUser().getIdentifier().equals(targetUser.getIdentifier())
|
if (canReadPermissions(user, targetUser)) {
|
||||||
|| user.getUser().isAdministrator()) {
|
|
||||||
|
|
||||||
// Read permission from database, return null if not found
|
// Read permission from database, return null if not found
|
||||||
SystemPermissionModel model = getPermissionMapper().selectOne(targetUser.getModel(), type);
|
SystemPermissionModel model = getPermissionMapper().selectOne(targetUser.getModel(), type);
|
||||||
|
Reference in New Issue
Block a user