org.exist.xmldb
Interface UserManagementService

All Superinterfaces:
Configurable, Service
All Known Implementing Classes:
LocalUserManagementService, RemoteUserManagementService

public interface UserManagementService
extends Service

An eXist-specific service which provides methods to manage users and permissions.

Author:
Wolfgang Meier Modified by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it

Method Summary
 void addUser(User user)
          Add a new user to the database
 void addUserGroup(User user)
          Update the specified user without update user's password Method added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it
 void chmod(int mode)
           
 void chmod(Resource resource, int mode)
          Change permissions for the specified resource.
 void chmod(Resource resource, String modeStr)
          Change permissions for the specified resource.
 void chmod(String modeStr)
          Change permissions for the current collection
 void chown(Resource res, User u, String group)
          Change owner and group of the specified resource.
 void chown(User u, String group)
          Change owner and group of the current collection.
 String[] getGroups()
          Retrieve a list of all existing groups.
 String getName()
          Get the name of this service
 Permission getPermissions(Collection coll)
          Get permissions for the specified collections
 Permission getPermissions(Resource res)
          Get permissions for the specified resource
 String getProperty(String property)
          Get a property defined by this service.
 User getUser(String name)
          Get a user record from the database
 User[] getUsers()
          Retrieve a list of all existing users.
 String getVersion()
          Get the version of this service
 String hasUserLock(Resource res)
          Check if the resource has a user lock.
 Permission[] listCollectionPermissions()
          Get permissions for all child collections contained in the current collection.
 Permission[] listResourcePermissions()
          Get permissions for all resources contained in the current collection.
 void lockResource(Resource res, User u)
          Lock the specified resource for the specified user.
 void removeGroup(User user, String rmgroup)
          Update the specified user removing a group from user's group Method added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it
 void removeUser(User user)
          Delete a user from the database
 void setCollection(Collection collection)
          Set the current collection for this service
 void setPermissions(Collection child, Permission perm)
          Set permissions for the specified collection.
 void setPermissions(Resource resource, Permission perm)
          Set permissions for the specified resource.
 void setProperty(String property, String value)
          Set a property for this service.
 void unlockResource(Resource res)
          Unlock the specified resource.
 void updateUser(User user)
          Update existing user information
 

Method Detail

getName

String getName()
Get the name of this service

Specified by:
getName in interface Service
Returns:
The name

getVersion

String getVersion()
Get the version of this service

Specified by:
getVersion in interface Service
Returns:
The version value

setPermissions

void setPermissions(Collection child,
                    Permission perm)
                    throws XMLDBException
Set permissions for the specified collection.

Parameters:
child -
perm -
Throws:
XMLDBException

setPermissions

void setPermissions(Resource resource,
                    Permission perm)
                    throws XMLDBException
Set permissions for the specified resource.

Parameters:
resource -
perm -
Throws:
XMLDBException

chown

void chown(User u,
           String group)
           throws XMLDBException
Change owner and group of the current collection.

Parameters:
u - Description of the Parameter
group - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

chown

void chown(Resource res,
           User u,
           String group)
           throws XMLDBException
Change owner and group of the specified resource.

Parameters:
res - Description of the Parameter
u - Description of the Parameter
group - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

chmod

void chmod(Resource resource,
           String modeStr)
           throws XMLDBException
Change permissions for the specified resource. Permissions are specified in a string according to the following format:
[user|group|other]=[+|-][read|write|update]
For example, to grant all permissions to the group and deny everything to others: group=+write,+read,+update,other=-read The changes are applied to the permissions currently active for this resource.

Parameters:
resource - Description of the Parameter
modeStr - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

chmod

void chmod(String modeStr)
           throws XMLDBException
Change permissions for the current collection

Parameters:
modeStr - String describing the permissions to grant or deny.
Throws:
XMLDBException

chmod

void chmod(int mode)
           throws XMLDBException
Throws:
XMLDBException

chmod

void chmod(Resource resource,
           int mode)
           throws XMLDBException
Change permissions for the specified resource.

Throws:
XMLDBException

lockResource

void lockResource(Resource res,
                  User u)
                  throws XMLDBException
Lock the specified resource for the specified user. A locked resource cannot be changed by other users (except users in group DBA) until the lock is released. Users with admin privileges can always change a resource.

Parameters:
res -
u -
Throws:
XMLDBException

hasUserLock

String hasUserLock(Resource res)
                   throws XMLDBException
Check if the resource has a user lock. Returns the name of the owner of the lock or null if no lock has been set on the resource.

Parameters:
res -
Returns:
Name of the owner of the lock
Throws:
XMLDBException

unlockResource

void unlockResource(Resource res)
                    throws XMLDBException
Unlock the specified resource. The current user has to be same who locked the resource. Exception: admin users can always unlock a resource.

Parameters:
res -
Throws:
XMLDBException

addUser

void addUser(User user)
             throws XMLDBException
Add a new user to the database

Parameters:
user - The feature to be added to the User attribute
Throws:
XMLDBException - Description of the Exception

updateUser

void updateUser(User user)
                throws XMLDBException
Update existing user information

Parameters:
user - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

getUser

User getUser(String name)
             throws XMLDBException
Get a user record from the database

Parameters:
name - Description of the Parameter
Returns:
The user value
Throws:
XMLDBException - Description of the Exception

getUsers

User[] getUsers()
                throws XMLDBException
Retrieve a list of all existing users.

Returns:
The users value
Throws:
XMLDBException - Description of the Exception

getGroups

String[] getGroups()
                   throws XMLDBException
Retrieve a list of all existing groups. Please note: new groups are created automatically if a new group is assigned to a user. You can't add or remove them.

Returns:
List of all existing groups.
Throws:
XMLDBException

getProperty

String getProperty(String property)
                   throws XMLDBException
Get a property defined by this service.

Specified by:
getProperty in interface Configurable
Parameters:
property - Description of the Parameter
Returns:
The property value
Throws:
XMLDBException - Description of the Exception

setProperty

void setProperty(String property,
                 String value)
                 throws XMLDBException
Set a property for this service.

Specified by:
setProperty in interface Configurable
Parameters:
property - The new property value
value - The new property value
Throws:
XMLDBException - Description of the Exception

setCollection

void setCollection(Collection collection)
                   throws XMLDBException
Set the current collection for this service

Specified by:
setCollection in interface Service
Parameters:
collection - The new collection value
Throws:
XMLDBException - Description of the Exception

getPermissions

Permission getPermissions(Collection coll)
                          throws XMLDBException
Get permissions for the specified collections

Parameters:
coll - Description of the Parameter
Returns:
The permissions value
Throws:
XMLDBException - Description of the Exception

getPermissions

Permission getPermissions(Resource res)
                          throws XMLDBException
Get permissions for the specified resource

Parameters:
res - Description of the Parameter
Returns:
The permissions value
Throws:
XMLDBException - Description of the Exception

listResourcePermissions

Permission[] listResourcePermissions()
                                     throws XMLDBException
Get permissions for all resources contained in the current collection. Returns a list of permissions in the same order as Collection.listResources().

Returns:
Permission[]
Throws:
XMLDBException

listCollectionPermissions

Permission[] listCollectionPermissions()
                                       throws XMLDBException
Get permissions for all child collections contained in the current collection. Returns a list of permissions in the same order as Collection.listChildCollections().

Returns:
Permission[]
Throws:
XMLDBException

removeUser

void removeUser(User user)
                throws XMLDBException
Delete a user from the database

Parameters:
user - User
Throws:
XMLDBException

addUserGroup

void addUserGroup(User user)
                  throws XMLDBException
Update the specified user without update user's password Method added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it

Parameters:
user - Description of the Parameter
Throws:
XMLDBException - Description of the Exception

removeGroup

void removeGroup(User user,
                 String rmgroup)
                 throws XMLDBException
Update the specified user removing a group from user's group Method added by {Marco.Tampucci, Massimo.Martinelli} @isti.cnr.it

Parameters:
user - Description of the Parameter
rmgroup - Description of group to remove
Throws:
XMLDBException - Description of the Exception


Copyright (C) Wolfgang Meier. All rights reserved.