Interface RepositorySetupService

  • All Known Implementing Classes:
    CoreRepositorySetupService

    public interface RepositorySetupService
    Security configuration management service
    • Method Detail

      • addJsonAcl

        void addJsonAcl​(@NotNull
                        @NotNull javax.jcr.Session session,
                        @NotNull
                        @NotNull String jsonFilePath,
                        @Nullable
                        @Nullable Map<String,​Object> values)
                 throws javax.jcr.RepositoryException,
                        IOException
        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" ] }] }]
        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
      • addJsonAcl

        void addJsonAcl​(@NotNull
                        @NotNull javax.jcr.Session session,
                        @NotNull
                        @NotNull Reader reader,
                        @Nullable
                        @Nullable Map<String,​Object> values)
                 throws javax.jcr.RepositoryException,
                        IOException
        Throws:
        javax.jcr.RepositoryException
        IOException
      • removeJsonAcl

        void removeJsonAcl​(@NotNull
                           @NotNull javax.jcr.Session session,
                           @NotNull
                           @NotNull String jsonFilePath,
                           @Nullable
                           @Nullable Map<String,​Object> values)
                    throws javax.jcr.RepositoryException,
                           IOException
        revert all changes made by 'addJsonAcl'... - use the same configuration file
        Throws:
        javax.jcr.RepositoryException
        IOException
      • removeJsonAcl

        void removeJsonAcl​(@NotNull
                           @NotNull javax.jcr.Session session,
                           @NotNull
                           @NotNull Reader reader,
                           @Nullable
                           @Nullable Map<String,​Object> values)
                    throws javax.jcr.RepositoryException,
                           IOException
        Throws:
        javax.jcr.RepositoryException
        IOException