Search in sources :

Example 6 with AtomicRight

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;
}
Also used : Operator(eu.ggnet.dwoss.rights.ee.entity.Operator) AtomicRight(eu.ggnet.dwoss.rights.api.AtomicRight)

Example 7 with AtomicRight

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);
    }
}
Also used : AtomicRight(eu.ggnet.dwoss.rights.api.AtomicRight)

Aggregations

AtomicRight (eu.ggnet.dwoss.rights.api.AtomicRight)7 Operator (eu.ggnet.dwoss.rights.ee.entity.Operator)5 RightsAgent (eu.ggnet.dwoss.rights.ee.RightsAgent)2 Persona (eu.ggnet.dwoss.rights.ee.entity.Persona)1 Accessable (eu.ggnet.saft.api.auth.Accessable)1