Class PropertyRestrictionBean
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.auth.policy.bean.PropertyRestrictionBean
-
- Direct Known Subclasses:
PropertyRestrictionBeanImpl
public abstract class PropertyRestrictionBean extends Object
Assists the role-based policies in determining whether a property or resource may be displayed, modified, or published in linked open data. There is a singleton bean that holds the current threshold role levels for displaying, modifying, or publishing restricted properties. Create this bean after the context models are in place. Add PropertyRestrictionListener to your EditProcessObject if you are editing a property, to ensure that the bean stays current.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPropertyRestrictionBean.SetupCreate the bean at startup and remove it at shutdown.
-
Field Summary
Fields Modifier and Type Field Description protected static PropertyRestrictionBeaninstanceprotected static Collection<String>PERMITTED_EXCEPTIONSprotected static Collection<String>PROHIBITED_NAMESPACES
-
Constructor Summary
Constructors Constructor Description PropertyRestrictionBean()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleancanDisplayPredicate(Property predicate, BaseResourceBean.RoleLevel userRole)If display of a predicate is restricted, the user's role must be at least as high as the restriction level.abstract booleancanDisplayResource(String resourceUri, BaseResourceBean.RoleLevel userRole)Any resource can be displayed.abstract booleancanModifyPredicate(Property predicate, BaseResourceBean.RoleLevel userRole)A predicate cannot be modified if its namespace is in the prohibited list (some exceptions are allowed).abstract booleancanModifyResource(String resourceUri, BaseResourceBean.RoleLevel userRole)A resource cannot be modified if its namespace is in the prohibited list (but some exceptions are allowed).abstract booleancanPublishPredicate(Property predicate, BaseResourceBean.RoleLevel userRole)If publishing of a predicate is restricted, the user's role must be at least as high as the restriction level.abstract booleancanPublishResource(String resourceUri, BaseResourceBean.RoleLevel userRole)Any resource can be published.static PropertyRestrictionBeangetBean()abstract voidupdateProperty(PropertyRestrictionLevels levels)The threshold values for this property may have changed.
-
-
-
Field Detail
-
instance
protected static volatile PropertyRestrictionBean instance
-
PROHIBITED_NAMESPACES
protected static final Collection<String> PROHIBITED_NAMESPACES
-
PERMITTED_EXCEPTIONS
protected static final Collection<String> PERMITTED_EXCEPTIONS
-
-
Method Detail
-
getBean
public static PropertyRestrictionBean getBean()
-
canDisplayResource
public abstract boolean canDisplayResource(String resourceUri, BaseResourceBean.RoleLevel userRole)
Any resource can be displayed. (Someday we may want to implement display restrictions based on VClass.)
-
canModifyResource
public abstract boolean canModifyResource(String resourceUri, BaseResourceBean.RoleLevel userRole)
A resource cannot be modified if its namespace is in the prohibited list (but some exceptions are allowed). (Someday we may want to implement modify restrictions based on VClass.)
-
canPublishResource
public abstract boolean canPublishResource(String resourceUri, BaseResourceBean.RoleLevel userRole)
Any resource can be published. (Someday we may want to implement publish restrictions based on VClass.)
-
canDisplayPredicate
public abstract boolean canDisplayPredicate(Property predicate, BaseResourceBean.RoleLevel userRole)
If display of a predicate is restricted, the user's role must be at least as high as the restriction level.
-
canModifyPredicate
public abstract boolean canModifyPredicate(Property predicate, BaseResourceBean.RoleLevel userRole)
A predicate cannot be modified if its namespace is in the prohibited list (some exceptions are allowed). If modification of a predicate is restricted, the user's role must be at least as high as the restriction level.
-
canPublishPredicate
public abstract boolean canPublishPredicate(Property predicate, BaseResourceBean.RoleLevel userRole)
If publishing of a predicate is restricted, the user's role must be at least as high as the restriction level.
-
updateProperty
public abstract void updateProperty(PropertyRestrictionLevels levels)
The threshold values for this property may have changed.
-
-