Package org.jboss.hal.meta.security
Class ElementGuard
- java.lang.Object
-
- org.jboss.hal.meta.security.ElementGuard
-
public class ElementGuard extends Object
Helper class to process elements with constraints in theirdata-constraintattributes. Toggles the element's visibility depending on theAuthorisationDecisionresult.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classElementGuard.ToggleToggle the CSS classCSS.rbacHiddenbased on the element's constraints.static classElementGuard.VisiblePredicate which returns only visible elements (elements which don't have the CSS classCSS.hidden).
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidprocessElements(AuthorisationDecision authorisationDecision, elemental2.dom.HTMLElement element)static voidprocessElements(AuthorisationDecision authorisationDecision, String selector)static voidtoggle(elemental2.dom.HTMLElement element, boolean condition)Adds theCSS.rbacHiddenCSS class ifcondition == true, removes it otherwise.
-
-
-
Method Detail
-
toggle
public static void toggle(elemental2.dom.HTMLElement element, boolean condition)Adds theCSS.rbacHiddenCSS class ifcondition == true, removes it otherwise.
-
processElements
public static void processElements(AuthorisationDecision authorisationDecision, String selector)
-
processElements
public static void processElements(AuthorisationDecision authorisationDecision, elemental2.dom.HTMLElement element)
-
-