Class EntityPermissionChecker
java.lang.Object
org.apache.ofbiz.entityext.permission.EntityPermissionChecker
EntityPermissionChecker Class
Services for granting operation permissions on Content entities in a data-driven manner.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static interface
static interface
static class
static class
static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkHasRoleOperations
(String partyId, List<String> targetOperations, Delegator delegator) static boolean
checkHasRoleOperations
(String partyId, EntityPermissionChecker.PermissionConditionGetter permissionConditionGetter, Delegator delegator) checkPermission
(GenericValue content, String statusId, GenericValue userLogin, List<String> passedPurposes, List<String> targetOperations, List<String> passedRoles, Delegator delegator, Security security, String entityAction) checkPermission
(GenericValue content, String statusId, GenericValue userLogin, List<String> passedPurposes, List<String> targetOperations, List<String> passedRoles, Delegator delegator, Security security, String entityAction, String privilegeEnumId, String quickCheckContentId) checkPermission
(GenericValue content, List<String> statusList, GenericValue userLogin, List<String> passedPurposes, List<String> targetOperations, List<String> passedRoles, Delegator delegator, Security security, String entityAction, String privilegeEnumId) checkPermission
(GenericValue content, List<String> statusList, GenericValue userLogin, List<String> passedPurposes, List<String> targetOperations, List<String> passedRoles, Delegator delegator, Security security, String entityAction, String privilegeEnumId, String quickCheckContentId) static boolean
checkPermissionMethod
(Delegator delegator, String partyId, String entityName, List<? extends Object> entityIdList, EntityPermissionChecker.AuxiliaryValueGetter auxiliaryValueGetter, EntityPermissionChecker.RelatedRoleGetter relatedRoleGetter, EntityPermissionChecker.PermissionConditionGetter permissionConditionGetter) static boolean
checkPermissionMethod
(Delegator delegator, GenericValue userLogin, List<String> targetOperationList, String entityName, List<? extends Object> entityIdList, List<String> purposeList, List<String> roleList, String privilegeEnumId) static void
getEntityOwners
(Delegator delegator, GenericValue entity, List<String> contentOwnerList, String entityName, String ownerIdFieldName) static GenericValue
getNextEntity
(Delegator delegator, String entityName, String pkFieldName, Object obj, Map<String, GenericValue> entities) static int
getPrivilegeEnumSeq
(Delegator delegator, String privilegeEnumId) getRelatedPurposes
(GenericValue entity, List<String> passedPurposes) getRelatedPurposesgetUserRoles
(GenericValue entity, GenericValue userLogin, Delegator delegator) getUserRoles Queries for the ContentRoles associated with a Content entity and returns the ones that match the user.getUserRolesFromList
(Delegator delegator, List<String> idList, String partyId, String entityIdFieldName, String partyIdFieldName, String roleTypeIdFieldName, String entityName) static boolean
hasMatch
(String entityName, List<GenericValue> targetOperations, List<String> roles, boolean hasPurposeOp, List<String> purposes, boolean hasStatusOp, String targStatusId) static boolean
hasMatch
(GenericValue entity, EntityPermissionChecker.PermissionConditionGetter permissionConditionGetter, EntityPermissionChecker.RelatedRoleGetter relatedRoleGetter, EntityPermissionChecker.AuxiliaryValueGetter auxiliaryValueGetter, String partyId, boolean checkAncestors) static boolean
isGroupMember
(Map<String, ?> partyRelationshipValues, Delegator delegator) Tests to see if the user belongs to a groupboolean
runPermissionCheck
(Map<String, ?> context) Run permission check boolean.
-
Constructor Details
-
EntityPermissionChecker
-
-
Method Details
-
runPermissionCheck
Run permission check boolean.- Parameters:
context
- the context- Returns:
- the boolean
-
checkPermission
-
checkPermission
public static Map<String,Object> checkPermission(GenericValue content, String statusId, GenericValue userLogin, List<String> passedPurposes, List<String> targetOperations, List<String> passedRoles, Delegator delegator, Security security, String entityAction, String privilegeEnumId, String quickCheckContentId) -
checkPermission
-
checkPermission
public static Map<String,Object> checkPermission(GenericValue content, List<String> statusList, GenericValue userLogin, List<String> passedPurposes, List<String> targetOperations, List<String> passedRoles, Delegator delegator, Security security, String entityAction, String privilegeEnumId, String quickCheckContentId) -
checkPermissionMethod
public static boolean checkPermissionMethod(Delegator delegator, GenericValue userLogin, List<String> targetOperationList, String entityName, List<? extends Object> entityIdList, List<String> purposeList, List<String> roleList, String privilegeEnumId) throws GenericEntityException - Throws:
GenericEntityException
-
checkPermissionMethod
public static boolean checkPermissionMethod(Delegator delegator, String partyId, String entityName, List<? extends Object> entityIdList, EntityPermissionChecker.AuxiliaryValueGetter auxiliaryValueGetter, EntityPermissionChecker.RelatedRoleGetter relatedRoleGetter, EntityPermissionChecker.PermissionConditionGetter permissionConditionGetter) throws GenericEntityException - Throws:
GenericEntityException
-
getNextEntity
public static GenericValue getNextEntity(Delegator delegator, String entityName, String pkFieldName, Object obj, Map<String, GenericValue> entities) throws GenericEntityException- Throws:
GenericEntityException
-
checkHasRoleOperations
public static boolean checkHasRoleOperations(String partyId, EntityPermissionChecker.PermissionConditionGetter permissionConditionGetter, Delegator delegator) -
checkHasRoleOperations
-
hasMatch
-
hasMatch
public static boolean hasMatch(GenericValue entity, EntityPermissionChecker.PermissionConditionGetter permissionConditionGetter, EntityPermissionChecker.RelatedRoleGetter relatedRoleGetter, EntityPermissionChecker.AuxiliaryValueGetter auxiliaryValueGetter, String partyId, boolean checkAncestors) throws GenericEntityException - Throws:
GenericEntityException
-
getRelatedPurposes
getRelatedPurposes -
getUserRoles
public static List<String> getUserRoles(GenericValue entity, GenericValue userLogin, Delegator delegator) throws GenericEntityException getUserRoles Queries for the ContentRoles associated with a Content entity and returns the ones that match the user. Follows group parties to see if the user is a member.- Throws:
GenericEntityException
-
isGroupMember
Tests to see if the user belongs to a group -
getUserRolesFromList
public static List<String> getUserRolesFromList(Delegator delegator, List<String> idList, String partyId, String entityIdFieldName, String partyIdFieldName, String roleTypeIdFieldName, String entityName) throws GenericEntityException - Throws:
GenericEntityException
-
getEntityOwners
public static void getEntityOwners(Delegator delegator, GenericValue entity, List<String> contentOwnerList, String entityName, String ownerIdFieldName) throws GenericEntityException - Throws:
GenericEntityException
-
getPrivilegeEnumSeq
public static int getPrivilegeEnumSeq(Delegator delegator, String privilegeEnumId) throws GenericEntityException - Throws:
GenericEntityException
-