Class CoreRepositorySetupService

    • Constructor Detail

      • CoreRepositorySetupService

        public CoreRepositorySetupService()
    • Method Detail

      • addJsonAcl

        public void addJsonAcl​(@NotNull
                               @NotNull javax.jcr.Session session,
                               @NotNull
                               @NotNull String jsonFilePath,
                               @Nullable
                               @Nullable Map<String,​Object> values)
                        throws javax.jcr.RepositoryException,
                               IOException
        Description copied from interface: RepositorySetupService
        adds ACL accordiong to rules declared as JSON file; e.g.
        • allow read for 'everyone' on root ('/') to walk trough (this node only)
        • deny read for 'a-group' on '/apps' and all subnodes and ensure that this folder and the group exists
        • make 'everyone' and 'someone' a member of 'a-group' (both principals must exist)
        • remove each ACL for 'a-group' from '/conf' and ensure that this group exists
        [{ "path": "/", "acl": [{ "principal": "everyone", "reset": true, "rules": [{ "grant": "jcr:read", "restrictions": { "rep:glob": "" } }] }] },{ "path": "/apps", "jcr:primaryType": "sling:Folder" "acl": [{ "principal": [ "a-group" "another-group" ], "groupPath": "example", "deny": [ "jcr:read" ] }] },{ "principal": [ "everyone", "someone" ], "memberOf": [ "a-group" ] }] },{ "path": "/conf", "acl": [{ "principal": "a-user", "userPath": "example", "memberOf": [ "a-group" ] }] }]
        Specified by:
        addJsonAcl in interface RepositorySetupService
        Parameters:
        session - the session (not resolver to make it easy usable in install hooks)
        jsonFilePath - a repository path to the ACL JSON file
        Throws:
        javax.jcr.RepositoryException
        IOException
      • addAclObject

        protected void addAclObject​(@NotNull
                                    @NotNull javax.jcr.Session session,
                                    @NotNull
                                    @NotNull com.google.gson.stream.JsonReader reader)
                             throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • removeAclObject

        protected void removeAclObject​(@NotNull
                                       @NotNull javax.jcr.Session session,
                                       @NotNull
                                       @NotNull com.google.gson.stream.JsonReader reader)
                                throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • addAcList

        protected void addAcList​(@NotNull
                                 @NotNull javax.jcr.Session session,
                                 @NotNull
                                 @NotNull String path,
                                 @NotNull
                                 @NotNull List<Map<String,​Object>> list)
                          throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • removeAcList

        protected void removeAcList​(@NotNull
                                    @NotNull javax.jcr.Session session,
                                    @NotNull
                                    @NotNull String path,
                                    @NotNull
                                    @NotNull List<Map<String,​Object>> list)
                             throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • addAcRule

        protected void addAcRule​(@NotNull
                                 @NotNull javax.jcr.Session session,
                                 @NotNull
                                 @NotNull String path,
                                 @NotNull
                                 @NotNull String principalName,
                                 boolean allow,
                                 @NotNull
                                 @NotNull String[] privilegeKeys,
                                 @NotNull
                                 @NotNull Map<String,​Object> restrictionKeys)
                          throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • removeAcRule

        protected void removeAcRule​(@NotNull
                                    @NotNull javax.jcr.Session session,
                                    @NotNull
                                    @NotNull String path,
                                    @Nullable
                                    @Nullable String principal)
                             throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • makeNodeAvailable

        protected javax.jcr.Node makeNodeAvailable​(@NotNull
                                                   @NotNull javax.jcr.Session session,
                                                   @NotNull
                                                   @NotNull String path,
                                                   @NotNull
                                                   @NotNull String primaryType)
                                            throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • removeNode

        protected void removeNode​(@NotNull
                                  @NotNull javax.jcr.Session session,
                                  @NotNull
                                  @NotNull String path)
                           throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • makeUserAvailable

        protected org.apache.jackrabbit.api.security.user.Authorizable makeUserAvailable​(@NotNull
                                                                                         @NotNull javax.jcr.Session session,
                                                                                         @NotNull
                                                                                         @NotNull String id,
                                                                                         @NotNull
                                                                                         @NotNull String intermediatePath)
                                                                                  throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • makeGroupAvailable

        protected org.apache.jackrabbit.api.security.user.Authorizable makeGroupAvailable​(@NotNull
                                                                                          @NotNull javax.jcr.Session session,
                                                                                          @NotNull
                                                                                          @NotNull String id,
                                                                                          @NotNull
                                                                                          @NotNull String intermediatePath)
                                                                                   throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • removeGroup

        protected void removeGroup​(@NotNull
                                   @NotNull javax.jcr.Session session,
                                   @NotNull
                                   @NotNull String id)
                            throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • makeMemberAvailable

        protected void makeMemberAvailable​(@NotNull
                                           @NotNull javax.jcr.Session session,
                                           @NotNull
                                           @NotNull String memberId,
                                           @NotNull
                                           @NotNull List<String> groupIds,
                                           @Nullable
                                           @Nullable String groupPath)
                                    throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • removeMember

        protected void removeMember​(@NotNull
                                    @NotNull javax.jcr.Session session,
                                    @NotNull
                                    @NotNull String memberId,
                                    @NotNull
                                    @NotNull List<String> groupIds)
                             throws javax.jcr.RepositoryException
        Throws:
        javax.jcr.RepositoryException
      • info

        protected void info​(String pattern,
                            Object... args)
      • warn

        protected void warn​(String pattern,
                            Object... args)
      • error

        protected void error​(String pattern,
                             Object... args)