Feat: field/add permissions for ClaimsProvider model #2671
+89
−11
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #2663
This PR sets visible/nonvisible and editable/readonly permissions on the fields of
ClaimsProvider
forsuperuser
andCal-ITP
group members, and letsCal-ITP
group members add instances of theClaimsProvider
model.Reviewing
Set
DJANGO_ALLOWED_HOSTS=benefits.calitp.org,localhost
in your.env
file (and don't forget tosource .env
in the dev container's terminal) so that you can see the addClaimsProvider
model behavior as it would run onprod
. Otherwise, you will always be able to add theClaimsProvider
model because ofLog in to the admin interface as a
superuser
and verify the checklist forsuperuser
shown below.Log in to the admin interface as a
Cal-ITP
group member (the easiest way to set up aCal-ITP
group member is to remove thesuperuser
attribute from thebenefits-admin
user and to add it to theCal-ITP
group) and verify the checklist forCal-ITP
group member shown below.For the verification, ensure model and field permissions match the permissions in the Benefits admin configuration spreadsheet for model/field permissions for each user level (
Admin
,Cal-ITP
,Transit agency
). Note that in this spreadsheet, each field indicate the lowest level user type, e.g. if a field is marked as readable byCal-ITP
, then it should also be readable by asuperuser
.superuser
ClaimsProvider
are visible and editable as beforeClaimsProvider
can be added as beforeCal-ITP
group memberClaimsProvider
model can be added AND saved