Search in sources :

Example 1 with AuthorisationDecision

use of org.jboss.hal.meta.security.AuthorisationDecision in project console by hal.

the class FinderRow method updatePreview.

void updatePreview() {
    if (isSelected()) {
        finder.showPreview(previewContent);
    }
    previewContent.update(item);
    AuthorisationDecision ad = AuthorisationDecision.from(finder.environment(), finder.securityContextRegistry());
    ElementGuard.processElements(ad, HASH + Ids.PREVIEW_ID + " [" + data(UIConstants.CONSTRAINT + "]"));
}
Also used : AuthorisationDecision(org.jboss.hal.meta.security.AuthorisationDecision)

Example 2 with AuthorisationDecision

use of org.jboss.hal.meta.security.AuthorisationDecision in project console by hal.

the class ModelNodeTable method applySecurity.

private void applySecurity() {
    AuthorisationDecision ad = AuthorisationDecision.from(Core.INSTANCE.environment(), metadata.getSecurityContext());
    ElementGuard.processElements(ad, element());
}
Also used : AuthorisationDecision(org.jboss.hal.meta.security.AuthorisationDecision)

Example 3 with AuthorisationDecision

use of org.jboss.hal.meta.security.AuthorisationDecision in project console by hal.

the class ServerColumn method processAddColumnAction.

private void processAddColumnAction(String host) {
    AuthorisationDecision ad = AuthorisationDecision.from(environment, c -> {
        if (securityContextRegistry.contains(c.getTemplate())) {
            return Optional.of(securityContextRegistry.lookup(c.getTemplate()));
        }
        return Optional.empty();
    });
    HTMLElement addButton = (HTMLElement) document.getElementById(Ids.SERVER_ADD);
    ElementGuard.toggle(addButton, !ad.isAllowed(Constraint.executable(serverConfigTemplate(host), ADD)));
}
Also used : HTMLElement(elemental2.dom.HTMLElement) AuthorisationDecision(org.jboss.hal.meta.security.AuthorisationDecision)

Aggregations

AuthorisationDecision (org.jboss.hal.meta.security.AuthorisationDecision)3 HTMLElement (elemental2.dom.HTMLElement)1