Skip to content

Commit d6902de

Browse files
committed
Fixes #555
1 parent b4da08d commit d6902de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

server/src/main/java/invite/api/RoleController.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package invite.api;
22

33
import invite.config.Config;
4+
import invite.exception.InvalidInputException;
45
import invite.exception.NotFoundException;
56
import invite.exception.UserRestrictionException;
67
import invite.logging.AccessLogger;
@@ -151,7 +152,9 @@ public ResponseEntity<List<Role>> rolesPerApplicationId(@PathVariable("manageId"
151152
public ResponseEntity<Role> newRole(@Validated @RequestBody Role role,
152153
@Parameter(hidden = true) User user) {
153154
LOG.debug(String.format("POST /roles/ for user %s", user.getEduPersonPrincipalName()));
154-
155+
if (role.getId() != null) {
156+
throw new InvalidInputException("Role id must be null for new Role");
157+
}
155158
UserPermissions.assertAuthority(user, Authority.INSTITUTION_ADMIN);
156159
//For super_users we allow an organization GUID from the input form
157160
if (InstitutionAdmin.isInstitutionAdmin(user)) {

0 commit comments

Comments
 (0)