Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

manual_override script to handle individual fixes #31

Closed
13 tasks done
astrochun opened this issue May 6, 2020 · 0 comments · Fixed by #45
Closed
13 tasks done

manual_override script to handle individual fixes #31

astrochun opened this issue May 6, 2020 · 0 comments · Fixed by #45
Assignees
Labels
enhancement New feature or request scripts Script development

Comments

@astrochun
Copy link
Contributor

astrochun commented May 6, 2020

There are two parts of this feature request:

First, this most likely will be used with quota increases, but can also be used with figshare groups / "portals".

When a quota request is approved, there needs to be a query to retrieve the specific user and perform the synchronization based on the change in a file that provides manual changes.

The simple solution is:

  1. LDAP query that retrieves a given user EDS uid and old figshare Grouper attributes based on the EDSuaid (NetID)
  2. Remove the user from appropriate figshare Grouper group using delta
  3. Add the user to the new figshare Grouper group using delta

The removal/addition can be done by creating a set from the LDAP query and stripping/adding the uid and passing to delta with the Grouper query. delta will identify the drops and additions.

There are a number of steps:

  • Create a user_update script that accepts inputs, such as the NetID, and the specified changes to quota or/and portal [5361b6f, 14de970, cccc483, 1492ea1, 33603a7, 3594a5e, d3bce32]
  • The script should have a number of handling such as incorrect netid [d3bce32], changing to the same portal [6699787], checking for whether the portal/quota exists first [65ea345, 225e580].
  • Update the manual CSV file to include the changes. Note that we want to keep the commented heading [ce16056, 8142215]
  • Add root option such that it simply removes current portal settings and defaults to the main/root level. This would require that we also remove it from the CSV files. Unsure if I should do something similar for quota [fd446c7 e4a2be0]
  • Retrieve current user Grouper figshare ismemberof attributes [0e560ac, 7d63c2b, 078385c, 7dd4195]
  • Remove from user from Grouper figshare ismemberof attributes [078385c, 14de970]
  • Factoring out common codes between manual_override and grouper_query to avoid circular imports [17fae2c, 70ca119, f899bd0]
  • Refactor delta codes to handle addition and deletion of a user via manual override [4228eae, 1492ea1]

Second, is the automation of handling changes to quota and/or portal based on an input database that is a CSV file. This ensures that when someone has a portal/quota change, it stays when the automated script is run. This requires:

  • Updating config/figshare.ini [531ca48]
  • Creating manual override templates [55dcdd1]
  • Excluding private CSV files in gitignore [d116f0f]
  • A manual_override module with a ManualOverride class [1102aa1, 7af93a4]
  • Update to script_run [b031f3e]
    - This will check whether the manual CSV files are present. If not, no manual override handling will happen. Note that additional testing is needed at a later point. A separate ticket will be created if the manual override handling fails (Failed error with manual_override from script_run #47).
@astrochun astrochun added the enhancement New feature or request label May 6, 2020
@astrochun astrochun self-assigned this May 6, 2020
astrochun added a commit that referenced this issue Jul 2, 2020
@astrochun astrochun moved this from To do to In progress in ReDATA Patron Management Software Jul 2, 2020
astrochun added a commit that referenced this issue Jul 7, 2020
@astrochun astrochun mentioned this issue Jul 7, 2020
10 tasks
astrochun added a commit that referenced this issue Jul 13, 2020
Fix variable typo name (quota_set -> portal_set)
astrochun added a commit that referenced this issue Jul 14, 2020
astrochun added a commit that referenced this issue Jul 14, 2020
Update user_update script accordingly
astrochun added a commit that referenced this issue Jul 14, 2020
Intended to handle manual override
astrochun added a commit that referenced this issue Jul 14, 2020
Simplify with grouper_delta_user() calls
astrochun added a commit that referenced this issue Jul 17, 2020
- retrieves CSV header via csv_commented_header()
- Saves the CSV header in update_dataframe()
- populate uaid correctly (no set)
- Set dtype for read_csv()
- retrieve CSV header
astrochun added a commit that referenced this issue Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request scripts Script development
Development

Successfully merging a pull request may close this issue.

1 participant