Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2006 BEA Systems, Inc. All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.netuix.application.communities.capabilities
Class CapabilityRoleBootstrapper

    java.lang.Object
      com.bea.netuix.application.communities.capabilities.CapabilityRoleBootstrapper

    public class CapabilityRoleBootstrapper

extends Object

Utility class that can be used to create role policies based on the set of defined Community capabilities as configured in communities-config.xml. This class can be used at app deployment or configuration time to create default role policies that allow communities applications to perform `isUserInRole` calls that are based on expression based roles that use the current user's `CommunityContext` to reference capabilities that cause the role evaluation to map to whether or not that user has the specified capability in the current community.

Field Summary
`static String` | `MEMBERSHIP_ROLE_EXPRESSION` Expression used to create the membership policy.
`static String` | `MEMBERSHIP_ROLE_NAME` The role name for the membership policy.
`static String` | `ROLE_EXPRESSION_PREFIX` Expression prefix for the expressions used to create capability policies.
`static String` | `ROLE_EXPRESSION_SUFFIX` Expression suffix for the expressions used to create capability policies.
`static String` | `ROLE_NAME_PREFIX` The role name prefix for use in creating all of the capability policies.

Constructor Summary
`CapabilityRoleBootstrapper(String entAppName, P13nContextHandler p13nContextHandler)` Creates a `CapabilityRoleBootstrapper` that is targetted at an enterprise application and that uses the default role policy expression prefix and suffix and role name prefix for create and remove role policy operations.
`CapabilityRoleBootstrapper(String entAppName, String roleNamePrefix, String roleExpressionPrefix, String roleExpressionSuffix, String membershipRoleName, String membershipRoleExpression, P13nContextHandler p13nContextHandler)` Creates a `CapabilityRoleBootstrapper` that is targetted at an enterprise application and that uses the specified role expression prefix and suffix and the specified role name prefix for creating and removing role policies.

Method Summary
`void` | `bootstrapRoles(String webappName)` Creates role policies for each of the defined `MembershipCapabilites` as configured in communities-config.xml.
`void` | `removeBootstrappedRoles(String webappName)` Removes role policies for each of the defined `MembershipCapabilites` as configured in communities-config.xml.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### ROLE_EXPRESSION_PREFIX

    public static final String ROLE_EXPRESSION_PREFIX

  Expression prefix for the expressions used to create capability policies. This is meant to be able to append the capability name followed by the role expression suffix to form a complete, distinct policy expression that specifies at least a capability from the CommunityPropertySet. This can be used as is or overridden using the alternate constructor.

  See Also
    Constants Summary

### ROLE_EXPRESSION_SUFFIX

    public static final String ROLE_EXPRESSION_SUFFIX

  Expression suffix for the expressions used to create capability policies. This is meant to be able to appended to the expression prefix and capability name to form a complete, distinct policy expression that specifies at least a capability from the CommunityPropertySet. This can be used as is or overridden using the alternate constructor.

  See Also
    Constants Summary

### MEMBERSHIP_ROLE_EXPRESSION

    public static final String MEMBERSHIP_ROLE_EXPRESSION

  Expression used to create the membership policy. The default version just checks to see if the membership property of the CommunityPropertySet returns true. This can be used as is or overridden using the altnernate constructor.

  See Also
    Constants Summary

### MEMBERSHIP_ROLE_NAME

    public static final String MEMBERSHIP_ROLE_NAME

  The role name for the membership policy. This can be used as is, or overridden using the altnernate constructor.

  See Also
    Constants Summary

### ROLE_NAME_PREFIX

    public static final String ROLE_NAME_PREFIX

  The role name prefix for use in creating all of the capability policies. This prefix is appended to each `MembershipCapability` canonical name to form the complete policy name. This can be used as is or overridden using the alternate constructor.

  See Also
    Constants Summary

Constructor Detail

### CapabilityRoleBootstrapper

    public CapabilityRoleBootstrapper(String entAppName,
                                      P13nContextHandler p13nContextHandler)

  Creates a `CapabilityRoleBootstrapper` that is targetted at an enterprise application and that uses the default role policy expression prefix and suffix and role name prefix for create and remove role policy operations. Use this form of the constructor if there is no need to customize either the role policy expressions or the role name prefix. Resulting role policy names for this default will be like this for capabilities creator and owner: communityCapabilityRole_creator communityCapabilityRole_owner and like this for the membership role: communityMembershipRole

  Parameters
    `entAppName` - the targetted enterprise application name
    `p13nContextHandler` - the P13nContextHandler of the calling user, needed if the admin role applicable to the caller is expression based, otherwise can be null

### CapabilityRoleBootstrapper

    public CapabilityRoleBootstrapper(String entAppName,
                                      String roleNamePrefix,
                                      String roleExpressionPrefix,
                                      String roleExpressionSuffix,
                                      String membershipRoleName,
                                      String membershipRoleExpression,
                                      P13nContextHandler p13nContextHandler)

  Creates a `CapabilityRoleBootstrapper` that is targetted at an enterprise application and that uses the specified role expression prefix and suffix and the specified role name prefix for creating and removing role policies. Use this form of the constructor if either the role expressions or the role names need to be customized from the default. The resulting role policy expressions will take the form of roleExpressionPrefix + capability canonical name + roleExpressionSuffix. The resulting role names will take the form of roleNamePrefix + capability canonical name

  Parameters
    `entAppName` - the enterprise app to bootstrap role policies to
    `roleNamePrefix` - the String prefix for all created capability role policies. If null set to default.
    `roleExpressionPrefix` - the expression prefix for all created capability role policies. If null set to default.
    `roleExpressionSuffix` - the expression suffix for all created cabability role policies. If null set to default.
    `membershipRoleName` - the role policy name for the created membership role. If null set to default.
    `membershipRoleExpression` - the expression for the created membership role. If null set to default.
    `p13nContextHandler` - the P13nContextHandler of the calling user, needed if the admin role applicable to the caller is expression based, otherwise can be null

Method Detail

### bootstrapRoles

    public void bootstrapRoles(String webappName)
                        throws com.bea.p13n.entitlements.common.PolicyCreateException,
                               com.bea.p13n.entitlements.common.PolicyNotFoundException,
                               com.bea.p13n.entitlements.common.PolicyException

  Creates role policies for each of the defined `MembershipCapabilites` as configured in communities-config.xml. The caller is responsible for ensuring the appropriate security environment as required for the successful insertion of new role policies, typically by calling this method after being logged in as an administrator or other principal that is authorized to manage role policies.

  Parameters
    `webappName` - webapp to create these role policies for. If null, role policies are ent app scoped
  Throws
    `com.bea.p13n.entitlements.common.PolicyCreateException`
    `com.bea.p13n.entitlements.common.PolicyNotFoundException`
    `com.bea.p13n.entitlements.common.PolicyException`

### removeBootstrappedRoles

    public void removeBootstrappedRoles(String webappName)
                                 throws com.bea.p13n.entitlements.common.PolicyRemoveException

  Removes role policies for each of the defined `MembershipCapabilites` as configured in communities-config.xml. The caller is responsible for ensuring the appropriate security environment as required for the successful removal of these role policies, typically by calling this method after being logged in as an administrator or other principal that is authorized to manage role policies.

  Parameters
    `webappName` - webapp to create these role policies for. If null, role policies are ent app scoped
  Throws
    `com.bea.p13n.entitlements.common.PolicyRemoveException`

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 BEA Systems, Inc. All Rights Reserved