站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.2 API 英文版文档

PortalPermissionFactory - JBOSS Portal 2.2 API 英文版文档


org.jboss.portal.security
Interface PortalPermissionFactory

All Known Implementing Classes:
JBossPortalPermissionFactory

public interface PortalPermissionFactory

A factory to create and check permissions for authorization decisions.


Method Summary
 boolean checkPermission(java.lang.String type, java.lang.String uri, java.lang.String actions)
          Check for authorization to access the provided portal object (handle) with the provided actions.
 PortalPermission createPermission(java.lang.String type, java.lang.String uri, java.lang.String actions)
          Create a permission for the provided handle and actions, based on the current permission configuration.
 

Method Detail

createPermission

public PortalPermission createPermission(java.lang.String type,
                                         java.lang.String uri,
                                         java.lang.String actions)
                                  throws PortalPolicyException
Create a permission for the provided handle and actions, based on the current permission configuration.

The created permission is usually used to configure a policy context with the allowed permissions

Parameters:
type -
uri - the resource identifier
actions - a comma separated list of actions to allow (the actions the permission will contain)
Returns:
the created permission class
Throws:
PortalPolicyConfigException - if no permission class was configured, or the permission could not be instantiated
PortalPolicyException

checkPermission

public boolean checkPermission(java.lang.String type,
                               java.lang.String uri,
                               java.lang.String actions)
                        throws PortalPolicyException
Check for authorization to access the provided portal object (handle) with the provided actions.

Parameters:
type -
uri -
actions - a comma separated list of actions to check authorization for
Returns:
true if the current PortalSubject is allowed to access the handle with the actions
Throws:
PortalPolicyConfigException - if no permission class was configured, or the permission could not be instantiated
PortalPolicyException
See Also:
PortalPolicyService, PortalPolicy, PortalSubject, SubjectAssociation, PolicyAssociation