Class AuthenticationVendorPrivilegesSummary
- java.lang.Object
-
- com.broadleafcommerce.data.tracking.core.policy.trackable.marketplace.vendor.support.AuthenticationVendorPrivilegesSummary
-
public class AuthenticationVendorPrivilegesSummary extends Object
A complex object used to describe characteristics of anAuthentication
that are interesting for vendor-discrimination behavior.- See Also:
AuthenticationVendorPrivilegesUtility
-
-
Constructor Summary
Constructors Constructor Description AuthenticationVendorPrivilegesSummary()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canEqual(Object other)
boolean
equals(Object o)
Set<String>
getAllAuthorities()
This is expected to be a comprehensive set of all authorities that the authentication has been granted, including any authorities that were restricted to certain restriction targets.Set<String>
getRestrictedVendorRefs()
The set of allvendor-type
restriction targets that the authentication has.Map<String,Set<String>>
getVendorRefsByRestrictedAuthority()
A map from"restricted authorities"
(ex: READ_PRODUCT) to all "vendor refs" (ex: a vendor ID or vendor code) that the authority has been granted to.int
hashCode()
boolean
isUnrestricted()
Whether or not the authentication has restrictions of any type (not just vendor).void
setAllAuthorities(Set<String> allAuthorities)
This is expected to be a comprehensive set of all authorities that the authentication has been granted, including any authorities that were restricted to certain restriction targets.void
setRestrictedVendorRefs(Set<String> restrictedVendorRefs)
The set of allvendor-type
restriction targets that the authentication has.void
setUnrestricted(boolean unrestricted)
Whether or not the authentication has restrictions of any type (not just vendor).void
setVendorRefsByRestrictedAuthority(Map<String,Set<String>> vendorRefsByRestrictedAuthority)
A map from"restricted authorities"
(ex: READ_PRODUCT) to all "vendor refs" (ex: a vendor ID or vendor code) that the authority has been granted to.String
toString()
-
-
-
Method Detail
-
isUnrestricted
public boolean isUnrestricted()
Whether or not the authentication has restrictions of any type (not just vendor). This is important, since it allows distinction between the scenario where an authentication is unrestricted vs when an authentication is restricted but doesn't have any vendor-type restrictions (in which case they cannot access any vendors).
-
getAllAuthorities
public Set<String> getAllAuthorities()
This is expected to be a comprehensive set of all authorities that the authentication has been granted, including any authorities that were restricted to certain restriction targets. In other words, if the authentication was granted an authority anywhere, within restriction(s) or otherwise, it should appear in this set.This can be useful, since some policy validations are only concerned about whether an authority has been granted in any capacity to the authentication rather than the specifics of which restriction(s) it might be granted in.
-
getRestrictedVendorRefs
public Set<String> getRestrictedVendorRefs()
The set of allvendor-type
restriction targets that the authentication has. Values are "vendor refs" (ex: a vendor ID or vendor code) that the authentication is restricted to.Note that the value of
isUnrestricted()
is important to understanding the value of this field. If an authentication is unrestricted, the value of this field should essentially be ignored, since the authentication should be able to access any vendor. However, if the authentication is restricted, then an empty set here means the authentication cannot access any vendor (this can happen if the authentication has restrictions, but none of them are vendor-type).
-
getVendorRefsByRestrictedAuthority
public Map<String,Set<String>> getVendorRefsByRestrictedAuthority()
A map from"restricted authorities"
(ex: READ_PRODUCT) to all "vendor refs" (ex: a vendor ID or vendor code) that the authority has been granted to.
-
setUnrestricted
public void setUnrestricted(boolean unrestricted)
Whether or not the authentication has restrictions of any type (not just vendor). This is important, since it allows distinction between the scenario where an authentication is unrestricted vs when an authentication is restricted but doesn't have any vendor-type restrictions (in which case they cannot access any vendors).
-
setAllAuthorities
public void setAllAuthorities(Set<String> allAuthorities)
This is expected to be a comprehensive set of all authorities that the authentication has been granted, including any authorities that were restricted to certain restriction targets. In other words, if the authentication was granted an authority anywhere, within restriction(s) or otherwise, it should appear in this set.This can be useful, since some policy validations are only concerned about whether an authority has been granted in any capacity to the authentication rather than the specifics of which restriction(s) it might be granted in.
-
setRestrictedVendorRefs
public void setRestrictedVendorRefs(Set<String> restrictedVendorRefs)
The set of allvendor-type
restriction targets that the authentication has. Values are "vendor refs" (ex: a vendor ID or vendor code) that the authentication is restricted to.Note that the value of
isUnrestricted()
is important to understanding the value of this field. If an authentication is unrestricted, the value of this field should essentially be ignored, since the authentication should be able to access any vendor. However, if the authentication is restricted, then an empty set here means the authentication cannot access any vendor (this can happen if the authentication has restrictions, but none of them are vendor-type).
-
setVendorRefsByRestrictedAuthority
public void setVendorRefsByRestrictedAuthority(Map<String,Set<String>> vendorRefsByRestrictedAuthority)
A map from"restricted authorities"
(ex: READ_PRODUCT) to all "vendor refs" (ex: a vendor ID or vendor code) that the authority has been granted to.
-
canEqual
protected boolean canEqual(Object other)
-
-