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); }