Skip to content

Commit babe3d6

Browse files
GitHub Issue 1300: BulkUpgradeGroupAction scoping changes
1 parent a7a27ed commit babe3d6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

core/src/org/labkey/core/security/SecurityApiActions.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,12 @@ public ApiResponse execute(GroupForm form, BindException errors)
11061106
throw new UnauthorizedException("You do not have permission to modify site-wide groups.");
11071107
}
11081108

1109+
// A project group must belong to the current container
1110+
if (_group.getContainer() != null && !container.getId().equals(_group.getContainer()))
1111+
{
1112+
throw new UnauthorizedException("The specified group does not belong to this project.");
1113+
}
1114+
11091115
SecurityController.verifyUserCanModifyGroup(_group, getUser());
11101116

11111117
Map<String, String> memberErrors = new HashMap<>();
@@ -1219,6 +1225,11 @@ private void addOrReplaceMembers(GroupForm form, Map<String, List<UserPrincipal>
12191225

12201226
if (principal == null && member.getEmail() != null) // create the user
12211227
{
1228+
if (!getContainer().hasPermission(getUser(), AddUserPermission.class))
1229+
{
1230+
memberErrors.put(member.getEmail(), "You do not have permission to create new users.");
1231+
continue;
1232+
}
12221233
try
12231234
{
12241235
SecurityManager.NewUserStatus status = SecurityManager.addUser(new ValidEmail(member.getEmail()), getUser());

0 commit comments

Comments
 (0)