Skip to content

Commit

Permalink
YDA-5435: Add ability to import external users
Browse files Browse the repository at this point in the history
  • Loading branch information
claravox authored and lwesterhof committed Oct 10, 2023
1 parent eaa0c99 commit b4ba301
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
8 changes: 1 addition & 7 deletions groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ def validate_data(ctx, data, allow_update):
if group.exists(ctx, groupname) and not allow_update:
errors.append('Group "{}" already exists'.format(groupname))

# Is user admin or has catergory add privileges?
# Is user admin or has category add privileges?
if not (is_admin or can_add_category):
if category not in getCategories(ctx):
# Insufficient permissions to add new category.
Expand All @@ -571,12 +571,6 @@ def validate_data(ctx, data, allow_update):
# Insufficient permissions to add new subcategory.
errors.append('Subcategory {} does not exist and cannot be created due to insufficient permissions.'.format(subcategory))

for the_user in managers + members + viewers:
if not is_internal_user(the_user):
# ensure that external users already have an iRODS account
# we do not want to be the actor that creates them
if not user.exists(ctx, the_user):
errors.append('Group {} has nonexisting external user {}'.format(groupname, the_user))
return errors


Expand Down
1 change: 1 addition & 0 deletions tests/features/api/api_group.feature
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ Feature: Group API
And user "[email protected]" is now a member of the group "research-csvtestgroup"
And user "[email protected]" is now a member of the group "research-csvtestgroup"
And user "[email protected]" is now a member of the group "research-csvtestgroup"
And user "[email protected]" is now a member of the group "research-csvtestgroup"


Scenario Outline: Group delete
Expand Down
2 changes: 1 addition & 1 deletion tests/step_defs/api/test_api_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def then_user_update_persisted(user, new_user, group_name):

@given('the Yoda API for processing csv group data API is queried', target_fixture="api_response")
def api_group_import_csv_data(user):
header_and_data = "category,subcategory,groupname,manager:manager,member:member1,member:member2,viewer:viewer1\rdefault-2,default-2,csvtestgroup,[email protected],[email protected],[email protected],[email protected]"
header_and_data = "category,subcategory,groupname,manager:manager,member:member1,member:member2,viewer:viewer1,member:member3\rdefault-2,default-2,csvtestgroup,[email protected],[email protected],[email protected],[email protected],[email protected]"
return api_request(
user,
"group_process_csv",
Expand Down

0 comments on commit b4ba301

Please sign in to comment.