Skip to content

Commit

Permalink
SHIBUI-2394
Browse files Browse the repository at this point in the history
Changes for 2438 admin created metadata starts approved
  • Loading branch information
chasegawa committed Oct 28, 2022
1 parent 2947793 commit fbef162
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ public EntityDescriptorRepresentation createNew(EntityDescriptorRepresentation e

EntityDescriptor ed = (EntityDescriptor) createDescriptorFromRepresentation(edRep);
ed.setIdOfOwner(userService.getCurrentUserGroup().getOwnerId());
if (userService.currentUserIsAdmin()) {
ed.setApproved(true);
}

ownershipRepository.deleteEntriesForOwnedObject(ed);
ownershipRepository.save(new Ownership(userService.getCurrentUserGroup(), ed));
Expand All @@ -245,6 +248,9 @@ public EntityDescriptorRepresentation createNewEntityDescriptorFromXMLOrigin(Ent
if (ed.getProtocol() == EntityDescriptorProtocol.OIDC) {
ed.getSPSSODescriptor("").addSupportedProtocol("http://openid.net/specs/openid-connect-core-1_0.html");
}
if (userService.currentUserIsAdmin()) {
ed.setApproved(true);
}
EntityDescriptor savedEntity = entityDescriptorRepository.save(ed);
return createRepresentationFromDescriptor(savedEntity);
}
Expand Down

0 comments on commit fbef162

Please sign in to comment.