use of eu.ggnet.saft.api.auth.Accessable in project dwoss by gg-net.
the class SwingClient method enableAccessRestrictions.
private void enableAccessRestrictions(Collection<MetaAction> metaActions) {
Guardian accessCos = Lookup.getDefault().lookup(Guardian.class);
if (accessCos != null) {
for (ActionFactory.MetaAction metaAction : metaActions) {
if (metaAction.getAction() instanceof Accessable) {
Accessable accessable = (Accessable) metaAction.getAction();
accessCos.add(accessable);
}
}
}
}
use of eu.ggnet.saft.api.auth.Accessable in project dwoss by gg-net.
the class AbstractGuardian method setRights.
/**
* This method set the Current {@link AtomicRight}'s to the given one and Enables/Disables all {@link Accessable} components.
* <p>
* @param dto is a {@link Operator} that will be setted.
*/
protected void setRights(Operator dto) {
operator = dto;
quickRights.put(dto.getQuickLoginKey(), dto);
for (Accessable accessable : accessables) {
accessable.setEnabled(false);
}
rights.clear();
rights.addAll(dto.getRights());
for (Accessable accessable : accessables) {
for (AtomicRight atomicRight : dto.getRights()) {
if (accessable.getNeededRight().equals(atomicRight))
accessable.setEnabled(true);
}
}
if (!StringUtils.isBlank(dto.getUsername())) {
for (UserChangeListener listener : userChangeListeners) {
listener.loggedIn(dto.getUsername());
}
}
}
Aggregations