Package ome.security.policy
Class BinaryAccessPolicy
- java.lang.Object
-
- ome.security.policy.BasePolicy
-
- ome.security.policy.BinaryAccessPolicy
-
- All Implemented Interfaces:
Policy
public class BinaryAccessPolicy extends BasePolicy
Policy which should be checked anytime access to original binary files in OMERO is being attempted. This check is in addition to the standard permission permission and is intended to allow customizing who has access to widely shared data.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
NAME
This string can also be found in the Constants.ice file in the blitz package.-
Fields inherited from class ome.security.policy.BasePolicy
types
-
-
Constructor Summary
Constructors Constructor Description BinaryAccessPolicy(java.util.Set<java.lang.Class<ome.model.IObject>> types, ACLVoter voter)
BinaryAccessPolicy(java.util.Set<java.lang.Class<ome.model.IObject>> types, ACLVoter voter, java.lang.String[] config)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkRestriction(ome.model.IObject obj)
LikePolicy.isRestricted(IObject)
but throws an appropriateSecurityViolation
subclass if the restriction is active.java.lang.String
getName()
Unique name for a class of restrictions that thisPolicy
will enforce.protected java.util.Set<java.lang.String>
groupRestrictions(ome.model.IObject obj)
boolean
isRestricted(ome.model.IObject obj)
Checks whether or not this instance would throw aSecurityViolation
if the same instance were passed toPolicy.checkRestriction(IObject)
.-
Methods inherited from class ome.security.policy.BasePolicy
getTypes
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
This string can also be found in the Constants.ice file in the blitz package.- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:Policy
Unique name for a class of restrictions that thisPolicy
will enforce. This string will be sent to clients viaPermissions.copyExtendedRestrictions()
in order to prevent exceptions, and server-code will pass the same name to the check method to potentially have an exception thrown.- Specified by:
getName
in interfacePolicy
- Specified by:
getName
in classBasePolicy
-
isRestricted
public boolean isRestricted(ome.model.IObject obj)
Description copied from interface:Policy
Checks whether or not this instance would throw aSecurityViolation
if the same instance were passed toPolicy.checkRestriction(IObject)
. This is likely determined by first testing the type of theIObject
and then that the current user context has access to the given context.- Specified by:
isRestricted
in interfacePolicy
- Overrides:
isRestricted
in classBasePolicy
- Parameters:
obj
- a non-nullIObject
instance.- Returns:
- true if this
Policy
decides that a restriction should be placed on the passed context.
-
groupRestrictions
protected java.util.Set<java.lang.String> groupRestrictions(ome.model.IObject obj)
-
checkRestriction
public void checkRestriction(ome.model.IObject obj)
Description copied from interface:Policy
LikePolicy.isRestricted(IObject)
but throws an appropriateSecurityViolation
subclass if the restriction is active.- Specified by:
checkRestriction
in interfacePolicy
- Overrides:
checkRestriction
in classBasePolicy
-
-