## org.exist.security
Class LDAPSecurityManager

    java.lang.Object
      org.exist.security.LDAPSecurityManager

All Implemented Interfaces:
  SecurityManager

Direct Known Subclasses:
  LDAPbindSecurityManager

public class LDAPSecurityManager
extends java.lang.Object
implements SecurityManager

Note: A lot of this code is "borrowed" from Tomcat's JNDIRealm.java

Author:
  R. Alexander Milowski

Field Summary

Fields inherited from interface org.exist.security.SecurityManager
`ACL_FILE, ACL_FILE_URI, DBA_GROUP, DBA_USER, GUEST_GROUP, GUEST_USER, SYSTEM_USER`

Constructor Summary
`LDAPSecurityManager()` Creates a new instance of LDAPSecurityManager

Method Summary
`void` `addGroup(java.lang.String name)`
`void` `attach(BrokerPool pool, DBBroker sysBroker)`
`void` `deleteUser(java.lang.String name)`
`void` `deleteUser(User user)`
`int` `getCollectionDefaultPerms()`
`Group` `getGroup(int gid)`
`Group` `getGroup(java.lang.String name)`
`java.lang.String[]` `getGroups()`
`ExistPDP` `getPDP()`
`int` `getResourceDefaultPerms()`
`User` `getUser(int uid)`
`User` `getUser(java.lang.String name)`
`User[]` `getUsers()`
`boolean` `hasAdminPrivileges(User user)`
`boolean` `hasGroup(java.lang.String name)`
`boolean` `hasUser(java.lang.String name)`
`boolean` `isXACMLEnabled()`
`void` `setGroupByIdPattern(java.lang.String pattern)`
`void` `setGroupByNamePattern(java.lang.String pattern)`
`void` `setUser(User user)`
`void` `setUserByIdPattern(java.lang.String pattern)`
`void` `setUserByNamePattern(java.lang.String pattern)` Set the message format pattern for selecting users in this Realm.

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### LDAPSecurityManager

    public LDAPSecurityManager()

  Creates a new instance of LDAPSecurityManager

Method Detail

### setUserByNamePattern

    public void setUserByNamePattern(java.lang.String pattern)

  Set the message format pattern for selecting users in this Realm. This may be one simple pattern, or multiple patterns to be tried, separated by parentheses. (for example, either "cn={0}", or "(cn={0})(cn={0},o=myorg)" Full LDAP search strings are also supported, but only the "OR", "|" syntax, so "(|(cn={0})(cn={0},o=myorg))" is also valid. Complex search strings with &, etc are NOT supported.

  Parameters:
    `pattern` - The new user pattern

### setUserByIdPattern

    public void setUserByIdPattern(java.lang.String pattern)

### setGroupByIdPattern

    public void setGroupByIdPattern(java.lang.String pattern)

### setGroupByNamePattern

    public void setGroupByNamePattern(java.lang.String pattern)

### attach

    public void attach(BrokerPool pool,
                       DBBroker sysBroker)

  Specified by:
    `attach` in interface `SecurityManager`

### addGroup

    public void addGroup(java.lang.String name)

  Specified by:
    `addGroup` in interface `SecurityManager`

### deleteUser

    public void deleteUser(java.lang.String name)
                    throws PermissionDeniedException

  Specified by:
    `deleteUser` in interface `SecurityManager`
  Throws:
    `PermissionDeniedException`

### deleteUser

    public void deleteUser(User user)
                    throws PermissionDeniedException

  Specified by:
    `deleteUser` in interface `SecurityManager`
  Throws:
    `PermissionDeniedException`

### getCollectionDefaultPerms

    public int getCollectionDefaultPerms()

  Specified by:
    `getCollectionDefaultPerms` in interface `SecurityManager`

### getGroup

    public Group getGroup(int gid)

  Specified by:
    `getGroup` in interface `SecurityManager`

### getGroup

    public Group getGroup(java.lang.String name)

  Specified by:
    `getGroup` in interface `SecurityManager`

### getGroups

    public java.lang.String[] getGroups()

  Specified by:
    `getGroups` in interface `SecurityManager`

### isXACMLEnabled

    public boolean isXACMLEnabled()

  Specified by:
    `isXACMLEnabled` in interface `SecurityManager`

### getPDP

    public ExistPDP getPDP()

  Specified by:
    `getPDP` in interface `SecurityManager`

### getResourceDefaultPerms

    public int getResourceDefaultPerms()

  Specified by:
    `getResourceDefaultPerms` in interface `SecurityManager`

### getUser

    public User getUser(int uid)

  Specified by:
    `getUser` in interface `SecurityManager`

### getUser

    public User getUser(java.lang.String name)

  Specified by:
    `getUser` in interface `SecurityManager`

### getUsers

    public User[] getUsers()

  Specified by:
    `getUsers` in interface `SecurityManager`

### hasAdminPrivileges

    public boolean hasAdminPrivileges(User user)

  Specified by:
    `hasAdminPrivileges` in interface `SecurityManager`

### hasUser

    public boolean hasUser(java.lang.String name)

  Specified by:
    `hasUser` in interface `SecurityManager`

### hasGroup

    public boolean hasGroup(java.lang.String name)

  Specified by:
    `hasGroup` in interface `SecurityManager`

### setUser

    public void setUser(User user)

  Specified by:
    `setUser` in interface `SecurityManager`

Copyright (C) Wolfgang Meier. All rights reserved.