Package io.jmix.security.impl.constraint
Class AuthenticationPolicyStore
java.lang.Object
io.jmix.security.impl.constraint.AuthenticationPolicyStore
- All Implemented Interfaces:
PolicyStore
@NullMarked
@Component("sec_AuthenticationPolicyStore")
public class AuthenticationPolicyStore
extends Object
implements PolicyStore
Resolves the current user's security policies from assigned roles and registered policy contributors.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<PolicyStoreContributor> protected CurrentAuthenticationprotected ExtendedEntitiesprotected ResourceRoleRepositoryprotected RoleGrantedAuthorityUtilsprotected RowLevelRoleRepository -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Stream<ResourcePolicy> extractResourcePoliciesFromAuthenticationByScope(Function<ResourceRole, Stream<ResourcePolicy>> extractor) protected Stream<RowLevelPolicy> protected <T> Stream<T> getContributorPolicies(Function<PolicyStoreContributor, Stream<T>> extractor) getEntityAttributesResourcePolicies(MetaClass metaClass, String attribute) getEntityAttributesResourcePoliciesByWildcard(String entityWildcard, String attributeWildcard) getEntityResourcePolicies(MetaClass metaClass) getEntityResourcePoliciesByWildcard(String wildcard) protected Stream<ResourcePolicy> getPoliciesStreamByTypeAndResources(ResourceRole resourceRole, String policyType, Collection<String> resources) getRowLevelPolicies(MetaClass metaClass) protected @Nullable StringgetScope(org.springframework.security.core.Authentication authentication) getSpecificResourcePolicies(String resourceName) protected booleanisAppliedForScope(ResourceRole resourceRole, @Nullable String scope)
-
Field Details
-
currentAuthentication
-
extendedEntities
-
resourceRoleRepository
-
rowLevelRoleRepository
-
roleGrantedAuthorityUtils
-
contributors
-
-
Constructor Details
-
AuthenticationPolicyStore
public AuthenticationPolicyStore()
-
-
Method Details
-
getRowLevelPolicies
- Specified by:
getRowLevelPoliciesin interfacePolicyStore
-
getEntityResourcePolicies
- Specified by:
getEntityResourcePoliciesin interfacePolicyStore
-
getEntityResourcePoliciesByWildcard
- Specified by:
getEntityResourcePoliciesByWildcardin interfacePolicyStore
-
getEntityAttributesResourcePolicies
public Stream<ResourcePolicy> getEntityAttributesResourcePolicies(MetaClass metaClass, String attribute) - Specified by:
getEntityAttributesResourcePoliciesin interfacePolicyStore
-
getEntityAttributesResourcePoliciesByWildcard
public Stream<ResourcePolicy> getEntityAttributesResourcePoliciesByWildcard(String entityWildcard, String attributeWildcard) - Specified by:
getEntityAttributesResourcePoliciesByWildcardin interfacePolicyStore
-
getSpecificResourcePolicies
- Specified by:
getSpecificResourcePoliciesin interfacePolicyStore
-
extractResourcePoliciesFromAuthenticationByScope
protected Stream<ResourcePolicy> extractResourcePoliciesFromAuthenticationByScope(Function<ResourceRole, Stream<ResourcePolicy>> extractor) -
extractRowLevelPoliciesFromAuthentication
protected Stream<RowLevelPolicy> extractRowLevelPoliciesFromAuthentication(Function<RowLevelRole, Stream<RowLevelPolicy>> extractor) -
getScope
protected @Nullable String getScope(org.springframework.security.core.Authentication authentication) -
isAppliedForScope
-
getPoliciesStreamByTypeAndResources
protected Stream<ResourcePolicy> getPoliciesStreamByTypeAndResources(ResourceRole resourceRole, String policyType, Collection<String> resources) -
getContributorPolicies
protected <T> Stream<T> getContributorPolicies(Function<PolicyStoreContributor, Stream<T>> extractor)
-