com.ivata.mask.persistence.right
Interface PersistenceRights

All Known Implementing Classes:
DefaultPersistenceRights

public interface PersistenceRights

An implementation of this interface must be provided to the persistence manager. If you don't need user rights, use the default implementation (which allows everything).

Since:
ivata masks 0.5 (2005-01-14)
Version:
$Revision: 1.2 $
Author:
Colin MacLeod colin.macleod@ivata.com
See Also:
DefaultPersistenceRights.

Method Summary
 boolean canAdd(java.lang.String userNameParam, java.lang.Class valueObjectClassParam)
          Discover whether or not the owner of the current persistence session has the right to add a value object of the given type.
 boolean canAmend(java.lang.String userNameParam, ValueObject valueObjectParam)
           Discover whether or not the owner of the current persistence session has the right to change this value object generally.
 boolean canAmend(java.lang.String userNameParam, ValueObject valueObjectParam, java.lang.String fieldNameParam)
           Discover whether or not the owner of the current persistence session has the right to change a specific field on this value object.
 boolean canRemove(java.lang.String userNameParam, ValueObject valueObjectParam)
           Discover whether or not the owner of the current persistence session has the right to remove this value object.
 

Method Detail

canAdd

public boolean canAdd(java.lang.String userNameParam,
                      java.lang.Class valueObjectClassParam)
Discover whether or not the owner of the current persistence session has the right to add a value object of the given type.

Parameters:
userNameParam - identifies the current user. May not be relevant to all system (when it can be null).
valueObjectClassParam - class of value object to be added to the system.
Returns:
true if the current persistence session may add an object of this type, otherwise false.

canAmend

public boolean canAmend(java.lang.String userNameParam,
                        ValueObject valueObjectParam)

Discover whether or not the owner of the current persistence session has the right to change this value object generally.

Note this method can return true but the field-name-specific version of canAmend returns false, in which case some fields can be changed but not all.

Parameters:
userNameParam - identifies the current user. May not be relevant to all system (when it can be null).
valueObjectParam - value object to be amended.
Returns:
true if the current persistence session may amend the object, otherwise false.

canAmend

public boolean canAmend(java.lang.String userNameParam,
                        ValueObject valueObjectParam,
                        java.lang.String fieldNameParam)

Discover whether or not the owner of the current persistence session has the right to change a specific field on this value object.

Note this method can return false but the generic-specific version of canAmend returns true, in which case some fields can be changed but not the one specified by fieldNameParam.

Parameters:
userNameParam - identifies the current user. May not be relevant to all system (when it can be null).
valueObjectParam - value object to be amended.
fieldNameParam - name of the field to be changed on this value object.
Returns:
true if the current persistence session may amend this field on this object, otherwise false.

canRemove

public boolean canRemove(java.lang.String userNameParam,
                         ValueObject valueObjectParam)

Discover whether or not the owner of the current persistence session has the right to remove this value object.

Parameters:
userNameParam - identifies the current user. May not be relevant to all system (when it can be null).
valueObjectParam - value object to be removed.
Returns:
true if the current persistence session may remove this object, otherwise false.


Copyright © 2001-2005 ivata limited. All Rights Reserved.