This is an automated email from the ASF dual-hosted git repository. rombert pushed a commit to annotated tag org.apache.sling.jcr.repoinit-1.0.0 in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-jcr-repoinit.git
commit 8791efe5b6c5a3ae2089722e50a988bd82600fe3 Author: Bertrand Delacretaz <bdelacre...@apache.org> AuthorDate: Thu Dec 31 09:31:17 2015 +0000 SLING-5355 - fail if Principal not found git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/acldef/oak-jcr@1722431 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/java/org/apache/sling/acldef/jcr/AclUtil.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/apache/sling/acldef/jcr/AclUtil.java b/src/main/java/org/apache/sling/acldef/jcr/AclUtil.java index 1a70be4..97f79ac 100644 --- a/src/main/java/org/apache/sling/acldef/jcr/AclUtil.java +++ b/src/main/java/org/apache/sling/acldef/jcr/AclUtil.java @@ -28,6 +28,7 @@ import javax.jcr.security.Privilege; import org.apache.jackrabbit.api.security.JackrabbitAccessControlList; import org.apache.jackrabbit.api.security.JackrabbitAccessControlManager; +import org.apache.jackrabbit.api.security.user.Authorizable; import org.apache.jackrabbit.commons.jackrabbit.authorization.AccessControlUtils; /** Utilities for ACL management */ @@ -56,7 +57,11 @@ public class AclUtil { } JackrabbitAccessControlList acl = AccessControlUtils.getAccessControlList(s, path); for(String principal : principals) { - final Principal p = ServiceUserUtil.getAuthorizable(s, principal).getPrincipal(); + final Authorizable a = ServiceUserUtil.getAuthorizable(s, principal); + if(a == null) { + throw new IllegalStateException("Principal not found:" + principal); + } + final Principal p = a.getPrincipal(); acl.addEntry(p, jcrPriv, isAllow); } getJACM(s).setPolicy(path, acl); -- To stop receiving notification emails like this one, please contact "commits@sling.apache.org" <commits@sling.apache.org>.