org.apache.jetspeed.security
Class PortalResourcePermission

java.lang.Object
  extended by java.security.Permission
      extended by org.apache.jetspeed.security.PortalResourcePermission
All Implemented Interfaces:
Serializable, Guard
Direct Known Subclasses:
FolderPermission, FragmentPermission, PagePermission, PortletPermission

public abstract class PortalResourcePermission
extends Permission

Generalized Portlet Resoure permission.

This code was partially inspired from articles from:

Author:
David Le Strat, David Sean Taylor
See Also:
Serialized Form

Field Summary
protected  int mask
          Mask used for determining what actions are allowed or requested.
 
Constructor Summary
PortalResourcePermission(String name, int mask)
          Constructor for PortletPermission.
PortalResourcePermission(String name, String actions)
          Constructor for PortletPermission.
 
Method Summary
 String getActions()
           
 int hashCode()
           
 boolean implies(Permission permission)
           
 PermissionCollection newPermissionCollection()
          Overrides Permission.newPermissionCollection().
static int parseActions(String actions)
          Parses the actions string.
 
Methods inherited from class java.security.Permission
checkGuard, equals, getName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

mask

protected final int mask

Mask used for determining what actions are allowed or requested.

Constructor Detail

PortalResourcePermission

public PortalResourcePermission(String name,
                                String actions)

Constructor for PortletPermission.

Parameters:
name - The portlet name.
actions - The actions on the portlet.

PortalResourcePermission

public PortalResourcePermission(String name,
                                int mask)

Constructor for PortletPermission.

Parameters:
name - The portlet name.
mask - The mask representing actions on the portlet.
Method Detail

hashCode

public int hashCode()
Specified by:
hashCode in class Permission
See Also:
Permission.hashCode()

getActions

public String getActions()
Specified by:
getActions in class Permission
See Also:
Permission.getActions()

implies

public boolean implies(Permission permission)
Specified by:
implies in class Permission

parseActions

public static int parseActions(String actions)

Parses the actions string.

Actions are separated by commas or white space.

Parameters:
actions - The actions

newPermissionCollection

public PermissionCollection newPermissionCollection()

Overrides Permission.newPermissionCollection().

Overrides:
newPermissionCollection in class Permission
See Also:
Permission.newPermissionCollection()


Copyright © 1999-2007 Apache Software Foundation. All Rights Reserved.