All Packages Class Hierarchy This Package Previous Next Index
Class semper.access.CapabilityInstance
java.lang.Object
|
+----semper.access.CapabilityInstance
- public abstract class CapabilityInstance
- extends Object
SEMPER Access Control.
Abstract class representing capability instance objects.
- Version:
- $Revision: 1.1 $ $Date: 1996/11/20 15:47:27 $
- Author:
- Jaap-Henk Hoepman ([email protected])
- See Also:
- Capability, EnabledCapabilityInstance, BoundedCapabilityInstance, PassWordCapabilityInstance
-
template
- The template of which this capability is an instance.
-
CapabilityInstance(Capability, AccessControlHandle)
- Create a new capability instance.
-
addToRole(RoleInstance)
- Add the capability to a role.
-
belongsToRole(RoleInstance)
- Check whether this capability belongs to the specified role.
-
enable()
- Query the user to enable the capability instance.
-
findUnlockedRole()
- Check whether the capability belongs to any unlocked role.
-
getDescription()
- Get description of this capability instance.
-
getInfo()
- Obtain a short string describing the capability instance and its parameters.
-
getName()
- Get name of this capability instance.
-
isEnabled()
- Check whether the capability is (still) enabled.
-
isenabledStr()
- Return a string describing the status of the capability.
-
removeFromRole(RoleInstance)
- Remove the capability from a role.
template
public Capability template
- The template of which this capability is an instance. The name and
description of this instance are obtainable through this link.
CapabilityInstance
public CapabilityInstance(Capability template,
AccessControlHandle owner)
- Create a new capability instance.
To create an instance, use Capability.createInstance instead.
- Parameters:
- template - the template for this instance
- owner - AccessControlHandle of the owner of the instance.
getName
public String getName()
- Get name of this capability instance.
- Returns:
- name of this capability instance.
getDescription
public String getDescription()
- Get description of this capability instance.
getInfo
public abstract String getInfo()
- Obtain a short string describing the capability instance and its parameters.
Useful for logging.
- Returns:
- A short string describing the capability instance.
addToRole
public void addToRole(RoleInstance r)
- Add the capability to a role.
- Parameters:
- r - role to add the capability to.
belongsToRole
public boolean belongsToRole(RoleInstance r)
- Check whether this capability belongs to the specified role.
- Parameters:
- r - role
- Returns:
- true if the capability belongs to this role, false otherwise.
removeFromRole
public void removeFromRole(RoleInstance r)
- Remove the capability from a role. If the capability is not a member,
nothing happens.
- Parameters:
- r - role to remove the capability from.
findUnlockedRole
protected boolean findUnlockedRole()
- Check whether the capability belongs to any unlocked role. If the
capability does not belong to an unlocked role, the user is first prompted
to unlock one of the roles the capability belongs to. If the user does not
unlock any of these roles, this method returns false. This is an internal
function (used by AccessMan in verifyCapability()).
- Returns:
- true if the capability belongs to an unlocked role, false otherwise.
- See Also:
- verifyCapability
isEnabled
protected abstract boolean isEnabled()
- Check whether the capability is (still) enabled. Depending on the type of
capability that instantiates this method, this may always return true
or eventually return false
This is an internal function (used by AcccessMan in verifyCapability()).
- Returns:
- true if the capability is enabled, false otherwise.
- See Also:
- verifyCapability
isenabledStr
public String isenabledStr()
- Return a string describing the status of the capability.
- Returns:
- "enabled" if enabled, "disabled" if not.
enable
public abstract boolean enable()
- Query the user to enable the capability instance.
- Returns:
- true if the capability instance was enabled, false otherwise
All Packages Class Hierarchy This Package Previous Next Index