|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.bea.content.federated.ContentSecurityHelper
public class ContentSecurityHelper
This class contains helper methods to manage security on content management resources.
| Field Summary | |
|---|---|
static ContextKey |
COMMUNITY_URI
optional. |
| Method Summary | |
|---|---|
static void |
cleanDanglingPolicies(ContentContext context)
Clean all the dangling policies in CM System for ALL the repositories. |
static void |
createDAPolicy(ContentContext context,
String taxonomy,
List<String> roleList,
String capability)
Create a DA security policy for the given taxonomy and capability. |
static void |
createVisitorSecurityPolicy(ContentContext context,
String taxonomy,
List<String> roleList,
String capability,
String providerName)
Create a visitor security policy for the given taxonomy and capability. |
static String |
getRootTaxonomy(String repositoryName,
String resourceType)
Return the taxonomy of the repository root |
static List<SecurityPolicyItem> |
getSecurityPolicies(String taxonomyStart,
int policyUser)
Gets all the security policies for a given user which start with the given taxonomy. |
static Subject |
getSubject()
Returns the currently logged in subject |
static String |
getTaxonomy(Node node)
Return the taxonomy of the node used by the Content Security Layer |
static String |
getTaxonomy(ObjectClass objectClass)
Return the taxonomy of the type used by the Content Security Layer |
static String |
getTaxonomy(Workflow workflow)
Return the taxonomy of the workflow object used by the Content Security Layer |
static String |
getUserName()
Gets the userName of the currently logged in user |
static boolean |
isAdminRole()
|
static void |
removeDAPolicy(ContentContext context,
String taxonomy,
String capability)
Remove the DA Policy set on the content resource |
static void |
removeVisitorPolicy(ContentContext context,
String taxonomy,
String capability,
String providerName)
Remove the visitor Policy set on the content resource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final ContextKey COMMUNITY_URI
| Method Detail |
|---|
public static Subject getSubject()
public static String getUserName()
public static String getRootTaxonomy(String repositoryName,
String resourceType)
resourceType - The resourceType defined in ContentEntitlementHelper [RESOURCE_CONTENT, RESOURCE_TYPE, RESOURCE_REPOSITORY]repositoryName - The name of the repository. If it's null, it will return taxonomy of the Virtual Repository
public static String getTaxonomy(Node node)
node - The node object
public static String getTaxonomy(ObjectClass objectClass)
objectClass - Object class to be checked.
public static String getTaxonomy(Workflow workflow)
workflow - The workflow object
public static void createVisitorSecurityPolicy(ContentContext context,
String taxonomy,
List<String> roleList,
String capability,
String providerName)
throws com.bea.p13n.entitlements.common.EntitlementsException,
com.bea.p13n.entitlements.common.PolicyCreateException,
com.bea.p13n.entitlements.common.PolicyExistsException,
RepositoryException
context - The contentContext objecttaxonomy - Taxonomy of the resource. Can be generated using
getTaxonomy(Node), getTaxonomy(ObjectClass) or getTaxonomy(Workflow)
for content specific resourcesroleList - The roleList associated with the security policy itemcapability - The visitor capability. Should only be a list of valid visitor
capabilities defined in ContentEntitlementHelper - CAN_VISITOR_CREATE/CAN_VISITOR_VIEW etcproviderName - Optional parameter, needs to be set only if the visitor security policy
is to be created in a different provider. If the policy is to be created in the default provider, this
variable can be set to null.
com.bea.p13n.entitlements.common.EntitlementsException - If an entitlement error occurs
com.bea.p13n.entitlements.common.PolicyCreateException - if an error occurs in creating a policy
com.bea.p13n.entitlements.common.PolicyExistsException - if the policy already exists
RepositoryException - for any other error
public static void removeVisitorPolicy(ContentContext context,
String taxonomy,
String capability,
String providerName)
throws com.bea.p13n.entitlements.common.EntitlementsException,
com.bea.p13n.entitlements.common.PolicyRemoveException,
com.bea.p13n.entitlements.common.PolicyNotFoundException,
RepositoryException
context - The contentContext object.taxonomy - Taxonomy of the resource. Can be generated using
getTaxonomy(Node), getTaxonomy(ObjectClass) or getTaxonomy(Workflow)
for content specific resourcescapability - The visitor capability. Should only be a list of valid visitor
capabilities defined in ContentEntitlementHelper - CAN_VISITOR_CREATE etc
To remove all capabilities, use the wildcard - *providerName - Optional parameter, needs to be set only if the visitor security policy
is to be removed for a different provider. If the policy is to be removed in the default provider, this
variable can be set to null. To remove the visitor policy from ALL security providers, specify * as it's value
com.bea.p13n.entitlements.common.EntitlementsException - If an entitlement error occurs
com.bea.p13n.entitlements.common.PolicyRemoveException - If the policy cannot be removed
com.bea.p13n.entitlements.common.PolicyNotFoundException - If the policy was not found
RepositoryException - For any other error
public static void createDAPolicy(ContentContext context,
String taxonomy,
List<String> roleList,
String capability)
throws com.bea.p13n.delegation.management.DelegationPolicyManagementException,
com.bea.p13n.entitlements.common.EntitlementsException,
RepositoryException
context - The ContentContext object.
Recommended use is only from within admin tools.taxonomy - Taxonomy of the resource. Can be generated using
getTaxonomy(Node), getTaxonomy(ObjectClass) or getTaxonomy(Workflow)
for content specific resourcescapability - The DA capability. Should only be a list of valid DA
capabilities defined in ContentEntitlementHelper - CAN_CREATE/CAN_DELETE etc
com.bea.p13n.entitlements.common.EntitlementsException - If an error occurs
com.bea.p13n.delegation.management.DelegationPolicyManagementException
com.bea.p13n.entitlements.common.EntitlementsException
RepositoryException
public static void removeDAPolicy(ContentContext context,
String taxonomy,
String capability)
throws com.bea.p13n.delegation.management.DelegationPolicyManagementException,
com.bea.p13n.entitlements.common.EntitlementsException,
RepositoryException
context - The ContentContext object.
Recommended use is only from within admin tools.taxonomy - Taxonomy of the resource. Can be generated using
getTaxonomy(Node), getTaxonomy(ObjectClass) or getTaxonomy(Workflow)
for content specific resourcescapability - The DA capability. Should only be a list of valid DA
capabilities defined in ContentEntitlementHelper - CAN_CREATE/CAN_DELETE etc
To remove all capabilities, use the wildcard - *
com.bea.p13n.delegation.management.DelegationPolicyManagementException
com.bea.p13n.entitlements.common.EntitlementsException
RepositoryExceptionpublic static boolean isAdminRole()
public static void cleanDanglingPolicies(ContentContext context)
throws RepositoryException,
com.bea.p13n.entitlements.common.PolicyRemoveException,
com.bea.p13n.entitlements.common.EntitlementsException,
com.bea.p13n.entitlements.common.PolicyNotFoundException,
com.bea.p13n.delegation.management.DelegationPolicyManagementException
context - The ContentContext object
RepositoryException - In case of errors in removing security policies
com.bea.p13n.entitlements.common.PolicyRemoveException - If the policy cannot be removed
com.bea.p13n.entitlements.common.EntitlementsException - In case of error in removing policies
com.bea.p13n.entitlements.common.PolicyNotFoundException - If policy is not found
com.bea.p13n.delegation.management.DelegationPolicyManagementException - If the delegated policy cannot be removed
public static List<SecurityPolicyItem> getSecurityPolicies(String taxonomyStart,
int policyUser)
throws RepositoryException
taxonomyStart - The start of the taxonomy. This method will throw an error if the taxonomy is null.policyUser - PolicyUser - EntitlementConstants.P13N_APPLICATION_POLICY || EntitlementConstants.P13N_ADMIN_POLICY
RepositoryException - for any other error cases.
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||