use of eu.ggnet.dwoss.rights.api.AtomicRight in project dwoss by gg-net.
the class RightsAgentStub method make.
public Operator make(String username, Collection<AtomicRight> activeRights) {
Operator o = new Operator();
o.setUsername(username);
for (AtomicRight right : activeRights) {
o.add(right);
}
return o;
}
use of eu.ggnet.dwoss.rights.api.AtomicRight in project dwoss by gg-net.
the class AbstractGuardian method add.
/**
* Add A {@link Accessable}.
* The {@link Accessable} get called the method {@link Accessable#setEnabled(boolean)} with true
* when the Rights are setted and the method {@link Accessable#getNeededRights()} returns a collection which has the {@link AtomicRight}
* containing.
* <p>
* @param accessable which should be added in a intern List/Set.
*/
@Override
public void add(Accessable accessable) {
accessables.add(accessable);
accessable.setEnabled(false);
for (AtomicRight atomicRight : rights) {
if (accessable.getNeededRight() == atomicRight)
accessable.setEnabled(true);
}
}
Aggregations