use of eu.ggnet.dwoss.rights.ee.entity.Operator in project dwoss by gg-net.
the class PersonaOperatorIT method testDuplicateRemoval.
/**
* Test, that duplicate Rights to Persona and Operator are only keept on the persona.
*/
@Test
public void testDuplicateRemoval() {
assertThat(agent).as("RightsAgent").isNotNull();
Operator op = new Operator("TestUser");
Persona p = new Persona("Testpersona");
p.add(CREATE_ANNULATION_INVOICE);
p = agent.store(p);
op.add(p);
op = agent.store(op);
// Now we have one operator with one persona with one right.
// adding the same right to the operator
op.add(CREATE_ANNULATION_INVOICE);
// This should clear the duplicated right.
op = agent.store(op);
assertThat(op.getRights()).describedAs("The Operator, that should not have any right, cause its duplicate of the persona.").doesNotContain(CREATE_ANNULATION_INVOICE);
}
use of eu.ggnet.dwoss.rights.ee.entity.Operator in project dwoss by gg-net.
the class RightsManagmentController method resetDeactiveRights.
private void resetDeactiveRights() {
Operator op = userlist.getSelectionModel().getSelectedItem();
deactivatedRightsList.clear();
deactivatedRightsList.addAll(EnumSet.complementOf(op.getAllActiveRights()));
}
use of eu.ggnet.dwoss.rights.ee.entity.Operator in project dwoss by gg-net.
the class RightsManagmentController method handleRemoveRightButton.
@FXML
private void handleRemoveRightButton() {
Operator op = userlist.getSelectionModel().getSelectedItem();
List<AtomicRight> selectedItems = new ArrayList<>(activeRights.getSelectionModel().getSelectedItems());
selectedOperator().removeAllRight(selectedItems);
resetDeactiveRights();
resetAllRights();
// setSelectedOperator(op);
Dl.remote().lookup(RightsAgent.class).store(op);
}
use of eu.ggnet.dwoss.rights.ee.entity.Operator 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;
}
Aggregations