Skip to content

Commit

Permalink
fix: add user-admin role to agency admins
Browse files Browse the repository at this point in the history
  • Loading branch information
idriss.naji committed Nov 28, 2022
1 parent e612558 commit 343156e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public Admin createNewAdminAgency(final CreateAgencyAdminDTO createAgencyAdminDT
final String password = userHelper.getRandomPassword();
identityClient.updatePassword(keycloakUserId, password);
identityClient.updateRole(keycloakUserId, UserRole.RESTRICTED_AGENCY_ADMIN);
identityClient.updateRole(keycloakUserId, UserRole.USER_ADMIN);

return adminRepository.save(buildAdmin(createAgencyAdminDTO, keycloakUserId));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,18 @@
import java.util.List;
import java.util.Set;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

public interface AdminAgencyRepository extends CrudRepository<AdminAgency, Long> {

List<AdminAgency> findByAdminId(String adminId);

List<AdminAgency> findByAdminIdAndAgencyId(String adminId, Long agencyId);

@Transactional
void deleteByAdminIdAndAgencyId(String adminId, Long agencyId);

@Transactional
void deleteByAdminId(String adminId);

List<AdminAgency> findByAdminIdIn(Set<String> adminIds);
Expand Down

0 comments on commit 343156e

Please sign in to comment.