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

Refactor Person and GuestPerson classes #53

Open
rsdoiel opened this issue Apr 22, 2021 · 0 comments
Open

Refactor Person and GuestPerson classes #53

rsdoiel opened this issue Apr 22, 2021 · 0 comments
Assignees
Labels
Enhancement ✨ New feature or request Refactoring ✄ Functional code that needs revision for ease of maintenance for future improvements

Comments

@rsdoiel
Copy link
Member

rsdoiel commented Apr 22, 2021

The structure of Person and GuestPerson behaves like GuestPerson is a subclass of Person. The Person class should be the parent and not sited to a specific database presentation or storage. A subclass would then be used for stored Person objects via the ORM. This will allow us to store a minimal class of users while allowing general access through the fact of having a Shibboleth/Basic Auth managed account.

Person class when instantiated holds a default user description with the uname assigned on instantiation (e.g. the value that Shibboleth passes as REMOTE_USER). It should contain the following attributes - uname, display_name, role. The person class would define a standard set of methods like has_role() these would return results based on the attributes held in the object instance.

A generalize function like person_from_environment() could then return a Person compatible object based on either the default Person class or the subclass where the attributes are populated via the ORM.

Ideally the server code should think all Person objects are the same but behind the scenes we only store rows in the SQL person table for specific people who require more than the minimum access.

The eventual goal is for people.py and people-manager to become a common package use across applications that we build for apps.library.caltech.edu.

@rsdoiel rsdoiel added Enhancement ✨ New feature or request Refactoring ✄ Functional code that needs revision for ease of maintenance for future improvements labels Apr 22, 2021
@rsdoiel rsdoiel self-assigned this Apr 22, 2021
@mhucka mhucka added Enhancement ✨ New feature or request and removed Enhancement ✨ New feature or request labels Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement ✨ New feature or request Refactoring ✄ Functional code that needs revision for ease of maintenance for future improvements
Projects
None yet
Development

No branches or pull requests

2 participants