Class OdfOrgunitRestrictionRule
- java.lang.Object
-
- org.ametys.plugins.odfweb.restrictions.rules.OdfOrgunitRestrictionRule
-
- All Implemented Interfaces:
OdfRestrictionRule
public class OdfOrgunitRestrictionRule extends Object implements OdfRestrictionRule
This implementation ofOdfRestrictionRule
restricts ODF to a orgunit and their child orgunits
-
-
Field Summary
Fields Modifier and Type Field Description private RootOrgUnitProvider
_ouProvider
private String
_rootOrgUnitId
-
Constructor Summary
Constructors Constructor Description OdfOrgunitRestrictionRule(RootOrgUnitProvider ouProvider, String orgUnitId)
Constructor for ODF rule restriction on a orgunit
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
contains(Program program)
Determines if this program is part of this restrictionExpression
getExpression()
Translate the restriction into an expression that can be used for repository query.boolean
hasOrgunitRestrictions()
Indicate if this restriction is related to orgunit
-
-
-
Field Detail
-
_ouProvider
private final RootOrgUnitProvider _ouProvider
-
_rootOrgUnitId
private final String _rootOrgUnitId
-
-
Constructor Detail
-
OdfOrgunitRestrictionRule
public OdfOrgunitRestrictionRule(RootOrgUnitProvider ouProvider, String orgUnitId)
Constructor for ODF rule restriction on a orgunit- Parameters:
ouProvider
- The orgunits providerorgUnitId
- The id of orgunit
-
-
Method Detail
-
getExpression
public Expression getExpression()
Description copied from interface:OdfRestrictionRule
Translate the restriction into an expression that can be used for repository query.- Specified by:
getExpression
in interfaceOdfRestrictionRule
- Returns:
- The restriction expression
-
contains
public boolean contains(Program program)
Description copied from interface:OdfRestrictionRule
Determines if this program is part of this restriction- Specified by:
contains
in interfaceOdfRestrictionRule
- Parameters:
program
- The program- Returns:
true
If the program is part of this restriction
-
hasOrgunitRestrictions
public boolean hasOrgunitRestrictions()
Description copied from interface:OdfRestrictionRule
Indicate if this restriction is related to orgunit- Specified by:
hasOrgunitRestrictions
in interfaceOdfRestrictionRule
- Returns:
- true if it is the case
-
-