Qizx/db 2.1 API

com.qizx.api
Interface AccessControl

All Known Implementing Classes:
AccessControlBase

public interface AccessControl

Abstract access control to the members of a Library.

An object implementing this interface can be plugged in a Library Manager to check whether a User may read or modify contents or properties of Documents and Collections.

Attention: AccessControl is not in charge of authenticating the User. This is the responsibility of the application.

Implementation remarks:


Method Summary
 AccessControl copy()
          Creates a new instance of the Access Control.
 boolean mayChangeContent(User user, LibraryMember member)
          Checks if a User has the permission to modify the contents of a Library Object.
 boolean mayChangeProperty(User user, LibraryMember member, String propertyName)
          Checks if a User has the permission to modify the value of a property of a Library member.
 boolean mayReadContent(User user, LibraryMember member)
          Checks if a User has the permission to get the contents of a Library member.
 boolean mayReadProperty(User user, LibraryMember member, String propertyName)
          Checks if a User has the permission to get the value of a property of a Library member.
 void reset()
          Resets the internal state when the Library session is updated by a commit(), rollback(), refresh() or lock().
 

Method Detail

mayReadContent

public boolean mayReadContent(User user,
                              LibraryMember member)
Checks if a User has the permission to get the contents of a Library member.

Parameters:
user - an implementation of a User, suitable for this AccessControl
member - Library object to check for permission
Returns:
true if the permission is granted.

mayChangeContent

public boolean mayChangeContent(User user,
                                LibraryMember member)
Checks if a User has the permission to modify the contents of a Library Object.

Parameters:
user - an implementation of a User, suitable for this AccessControl
member - Library object to check for permission
Returns:
true if the permission is granted.

mayReadProperty

public boolean mayReadProperty(User user,
                               LibraryMember member,
                               String propertyName)
Checks if a User has the permission to get the value of a property of a Library member.

Parameters:
user - an implementation of a User, suitable for this AccessControl
member - Library Object to check for permission
propertyName - name of the property to get. Attention: it may be null, meaning 'any property' (for example when controlling for the method getPropertyNames() of LibraryMember).
Returns:
true if the permission is granted.

mayChangeProperty

public boolean mayChangeProperty(User user,
                                 LibraryMember member,
                                 String propertyName)
Checks if a User has the permission to modify the value of a property of a Library member.

Parameters:
user - an implementation of a User, suitable for this AccessControl
member - Library Object to check for permission
propertyName - name of the property to set. Never null
Returns:
true if the permission is granted.

copy

public AccessControl copy()
Creates a new instance of the Access Control.

This method is used when a new session is created. Typically it would initialize the new instance with settings copied from the master AccessControl specified on the LibraryManager.

Returns:
an AccessControl instance specific to a session

reset

public void reset()
Resets the internal state when the Library session is updated by a commit(), rollback(), refresh() or lock().

This method typically clears internal permission caches in order to recompute permissions properly.


© 2008 Axyana Software