sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bdelacre...@apache.org
Subject [sling-org-apache-sling-launchpad-integration-tests] branch master updated: SLING-7635 - add null check for Authorizable
Date Mon, 07 May 2018 08:45:58 GMT
This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-launchpad-integration-tests.git


The following commit(s) were added to refs/heads/master by this push:
     new 6d00403  SLING-7635 - add null check for Authorizable
6d00403 is described below

commit 6d00403830dc5f991b0463db3913ea88b3efd547
Author: Bertrand Delacretaz <bdelacretaz@apache.org>
AuthorDate: Mon May 7 10:45:47 2018 +0200

    SLING-7635 - add null check for Authorizable
---
 .../integration-test/usermanager/privileges-info.json.esp     | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/main/resources/integration-test/usermanager/privileges-info.json.esp b/src/main/resources/integration-test/usermanager/privileges-info.json.esp
index 4977081..08bda9c 100644
--- a/src/main/resources/integration-test/usermanager/privileges-info.json.esp
+++ b/src/main/resources/integration-test/usermanager/privileges-info.json.esp
@@ -18,13 +18,14 @@
  * under the License.
  */
 
- var privilegesInfo = sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);
- var authorizable = resource.adaptTo(Packages.org.apache.jackrabbit.api.security.user.Authorizable);
+var privilegesInfo = sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);
+var authorizable = resource.adaptTo(Packages.org.apache.jackrabbit.api.security.user.Authorizable);
+var userID = authorizable ? authorizable.getID() : null;
 %>
 {
 	"canAddUser" : <%=privilegesInfo.canAddUser(currentSession)%>,
 	"canAddGroup" : <%=privilegesInfo.canAddGroup(currentSession)%>,
-	"canUpdateProperties" : <%=privilegesInfo.canUpdateProperties(currentSession, authorizable.getID())%>,
-	"canRemove" : <%=privilegesInfo.canRemove(currentSession, authorizable.getID())%>,
-	"canUpdateGroupMembers" : <%=privilegesInfo.canUpdateGroupMembers(currentSession, authorizable.getID())%>
+	"canUpdateProperties" : <%=privilegesInfo.canUpdateProperties(currentSession, userID)%>,
+	"canRemove" : <%=privilegesInfo.canRemove(currentSession, userID)%>,
+	"canUpdateGroupMembers" : <%=privilegesInfo.canUpdateGroupMembers(currentSession, userID)%>
 }

-- 
To stop receiving notification emails like this one, please contact
bdelacretaz@apache.org.

Mime
View raw message