From 12ff4fcbebde717cc4654e9e726b9b6425370ff1 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Tue, 20 Nov 2018 13:08:45 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/branches/data-access/storagehub-webapp/1.0@174238 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../gcube/data/access/storagehub/AuthorizationChecker.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/gcube/data/access/storagehub/AuthorizationChecker.java b/src/main/java/org/gcube/data/access/storagehub/AuthorizationChecker.java index 4e2c10d..dae87c9 100644 --- a/src/main/java/org/gcube/data/access/storagehub/AuthorizationChecker.java +++ b/src/main/java/org/gcube/data/access/storagehub/AuthorizationChecker.java @@ -35,12 +35,12 @@ public class AuthorizationChecker { if (item==null) throw new UserNotAuthorizedException("Insufficent Provileges for user "+login+" to read node with id "+id+": it's not a valid StorageHub node"); if (item.isPublicItem()) return; - + if (item.isShared()) { SharedFolder parentShared = node2Item.getItem(retrieveSharedFolderParent(node, session), Excludes.EXCLUDE_ACCOUNTING); if (!parentShared.getUsers().getValues().containsKey(login)) throw new UserNotAuthorizedException("Insufficent Provileges for user "+login+" to read node with id "+id); - } else if (!item.getOwner().equals(login)) + } else if (item.getOwner()==null || !item.getOwner().equals(login)) throw new UserNotAuthorizedException("Insufficent Provileges for user "+login+" to read node with id "+id); }