use of org.simbasecurity.core.domain.Role in project simba-os by cegeka.
the class RoleManagerService method addPolicies.
@RequestMapping("addPolicies")
@ResponseBody
public void addPolicies(@JsonBody("role") RoleDTO role, @JsonBody("policies") List<PolicyDTO> policies) {
Role attachedRole = roleRepository.refreshWithOptimisticLocking(role);
Collection<Policy> attachedPolicies = policyRepository.refreshWithOptimisticLocking(policies);
attachedRole.addPolicies(attachedPolicies);
roleRepository.persist(attachedRole);
}
Aggregations