Package org.apache.sling.feature.cpconverter.accesscontrol

## Class DefaultAclManager

- java.lang.Object
- - org.apache.sling.feature.cpconverter.accesscontrol.DefaultAclManager

All Implemented Interfaces:
  `AclManager`, `EnforceInfo`

    public class DefaultAclManager
    extends Object
    implements AclManager, EnforceInfo

### Constructor Summary

Constructors
`DefaultAclManager()` Same as `DefaultAclManager(null, "system", false)`
`DefaultAclManager​(@Nullable String enforcePrincipalBasedSupportedPath, @NotNull String systemRelPath)` Deprecated. Use DefaultAclManager(String,String,boolean) instead
`DefaultAclManager​(@Nullable String enforcePrincipalBasedSupportedPath, @NotNull String systemRelPath, boolean alwaysForceSystemUserPath)` Creates a new instance of `DefaultAclManager`.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `addAccessControlEntry​(@NotNull String systemUser, @NotNull AccessControlEntry acl)`
`boolean` `addGroup​(@NotNull Group group)`
`void` `addMapping​(@NotNull Mapping mapping)`
`void` `addNodetypeRegistration​(@NotNull String cndStatements)`
`void` `addPrivilegeDefinitions​(@NotNull org.apache.jackrabbit.vault.fs.spi.PrivilegeDefinitions privilegeDefinitions)`
`void` `addRepoinitExtension​(@NotNull List<VaultPackageAssembler> packageAssemblers, @NotNull FeaturesManager featureManager)`
`void` `addRepoinitExtention​(@NotNull String source, @Nullable String repoInitText, @Nullable String runMode, @NotNull FeaturesManager featuresManager)`
`boolean` `addSystemUser​(@NotNull SystemUser systemUser)`
`boolean` `addUser​(@NotNull User user)`
`@NotNull String` `calculateEnforcedIntermediatePath​(@Nullable String intermediatePath)`
`boolean` `enforcePath​(@NotNull String systemUserId)`
`boolean` `enforcePrincipalBased​(@NotNull String systemUserId)`
`protected @Nullable org.apache.sling.repoinit.parser.operations.CreatePath` `getCreatePath​(@NotNull RepoPath path, @NotNull List<VaultPackageAssembler> packageAssemblers)`
`void` `recordSystemUserIds​(@NotNull String... systemUserIds)`
`void` `reset()`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DefaultAclManager

    public DefaultAclManager()

Same as `DefaultAclManager(null, "system", false)`

See Also:
  `ConverterConstants.SYSTEM_USER_REL_PATH_DEFAULT`

#### DefaultAclManager

    @Deprecated
    public DefaultAclManager​(@Nullable
                             @Nullable String enforcePrincipalBasedSupportedPath,
                             @NotNull
                             @NotNull String systemRelPath)

Deprecated.
Use DefaultAclManager(String,String,boolean) instead

Parameters:
  `enforcePrincipalBasedSupportedPath` - The supported path if principal-based access control setup for service users should be enforced; `null` otherwise.
  `systemRelPath` - The relative intermediate path used for all system users.

#### DefaultAclManager

    public DefaultAclManager​(@Nullable
                             @Nullable String enforcePrincipalBasedSupportedPath,
                             @NotNull
                             @NotNull String systemRelPath,
                             boolean alwaysForceSystemUserPath)

Creates a new instance of `DefaultAclManager`.

Parameters:
  `enforcePrincipalBasedSupportedPath` - The supported path if principal-based access control setup for service users should be enforced; `null` otherwise.
  `systemRelPath` - The relative intermediate path used for all system users.
  `alwaysForceSystemUserPath` - Option to make sure all system users are being created with the specified intermediate path (i.e. translating to 'with forced path' statements in repoinit).

### Method Detail

#### addUser

    public boolean addUser​(@NotNull
                           @NotNull User user)

Specified by:
  `addUser` in interface `AclManager`

#### addGroup

    public boolean addGroup​(@NotNull
                            @NotNull Group group)

Specified by:
  `addGroup` in interface `AclManager`

#### addSystemUser

    public boolean addSystemUser​(@NotNull
                                 @NotNull SystemUser systemUser)

Specified by:
  `addSystemUser` in interface `AclManager`

#### addMapping

    public void addMapping​(@NotNull
                           @NotNull Mapping mapping)

Specified by:
  `addMapping` in interface `AclManager`

#### addAccessControlEntry

    public boolean addAccessControlEntry​(@NotNull
                                         @NotNull String systemUser,
                                         @NotNull
                                         @NotNull AccessControlEntry acl)

Specified by:
  `addAccessControlEntry` in interface `AclManager`

#### addRepoinitExtension

    public void addRepoinitExtension​(@NotNull
                                     @NotNull List<VaultPackageAssembler> packageAssemblers,
                                     @NotNull
                                     @NotNull FeaturesManager featureManager)
                              throws IOException,
                                     ConverterException

Specified by:
  `addRepoinitExtension` in interface `AclManager`
Throws:
  `IOException`
  `ConverterException`

#### addRepoinitExtention

    public void addRepoinitExtention​(@NotNull
                                     @NotNull String source,
                                     @Nullable
                                     @Nullable String repoInitText,
                                     @Nullable
                                     @Nullable String runMode,
                                     @NotNull
                                     @NotNull FeaturesManager featuresManager)
                              throws IOException,
                                     ConverterException

Specified by:
  `addRepoinitExtention` in interface `AclManager`
Throws:
  `IOException`
  `ConverterException`

#### addNodetypeRegistration

    public void addNodetypeRegistration​(@NotNull
                                        @NotNull String cndStatements)

Specified by:
  `addNodetypeRegistration` in interface `AclManager`

#### addPrivilegeDefinitions

    public void addPrivilegeDefinitions​(@NotNull
                                        @NotNull org.apache.jackrabbit.vault.fs.spi.PrivilegeDefinitions privilegeDefinitions)

Specified by:
  `addPrivilegeDefinitions` in interface `AclManager`

#### reset

    public void reset()

Specified by:
  `reset` in interface `AclManager`

#### recordSystemUserIds

    public void recordSystemUserIds​(@NotNull
                                    @NotNull String... systemUserIds)

Specified by:
  `recordSystemUserIds` in interface `EnforceInfo`

#### enforcePrincipalBased

    public boolean enforcePrincipalBased​(@NotNull
                                         @NotNull String systemUserId)

Specified by:
  `enforcePrincipalBased` in interface `EnforceInfo`

#### enforcePath

    public boolean enforcePath​(@NotNull
                               @NotNull String systemUserId)

Specified by:
  `enforcePath` in interface `EnforceInfo`

#### calculateEnforcedIntermediatePath

    @NotNull
    public @NotNull String calculateEnforcedIntermediatePath​(@Nullable
                                                             @Nullable String intermediatePath)
                                                      throws ConverterException

Specified by:
  `calculateEnforcedIntermediatePath` in interface `EnforceInfo`
Throws:
  `ConverterException`

#### getCreatePath

    @Nullable
    protected @Nullable org.apache.sling.repoinit.parser.operations.CreatePath getCreatePath​(@NotNull
                                                                                             @NotNull RepoPath path,
                                                                                             @NotNull
                                                                                             @NotNull List<VaultPackageAssembler> packageAssemblers)