@Transactional
@Restrict({@Group("manager"), @Group("admin"), @Group("supervisor"), @Group("executor"), @Group("delivery-manager")})
public static Result getByRole(String roleName) {
try {
UserRole role = DaoManager.getUserRoleDao().findByName(roleName);
if (role == null) {
return notFound("Can't find role " + roleName);
}
List<User> users = DaoManager.getUserDao().findByRole(role);
UsersListDto usersDto = UsersListDto.createFrom(users, 1);