improve the comments clarifying the null scenario

This commit is contained in:
Andrea Bollini
2020-02-27 15:40:14 +01:00
parent 9e08df614a
commit 0403f45dc1

View File

@@ -92,7 +92,7 @@ public class AuthorizationRestRepository extends DSpaceRestRepository<Authorizat
if (authorizationFeature == null) { if (authorizationFeature == null) {
return null; return null;
} }
// get the user specified identified by the id // get the user specified identified by the id, can be null for anonymous
EPerson user; EPerson user;
try { try {
user = authorizationRestUtil.getEperson(context, id); user = authorizationRestUtil.getEperson(context, id);
@@ -154,7 +154,7 @@ public class AuthorizationRestRepository extends DSpaceRestRepository<Authorizat
} }
EPerson currUser = context.getCurrentUser(); EPerson currUser = context.getCurrentUser();
// get the user specified in the requested parameters // get the user specified in the requested parameters, can be null for anonymous
EPerson user = getUserFromRequestParameter(context, epersonUuid); EPerson user = getUserFromRequestParameter(context, epersonUuid);
// Temporarily change the Context's current user in order to retrieve // Temporarily change the Context's current user in order to retrieve
// authorizations based on that user // authorizations based on that user
@@ -204,7 +204,7 @@ public class AuthorizationRestRepository extends DSpaceRestRepository<Authorizat
} }
EPerson currUser = context.getCurrentUser(); EPerson currUser = context.getCurrentUser();
// get the user specified in the requested parameters // get the user specified in the requested parameters, can be null for anonymous
EPerson user = getUserFromRequestParameter(context, epersonUuid); EPerson user = getUserFromRequestParameter(context, epersonUuid);
// Temporarily change the Context's current user in order to retrieve // Temporarily change the Context's current user in order to retrieve
// authorizations based on that user // authorizations based on that user