Open fyliu opened 1 year ago
created_by and updated_by are both foreign keys containing user ids. If a permission isn't what it should be, we can use these values to figure out who to ask. I've just added the fields to the spreadsheet.
@Neecolaa This table is really a "membership" relationship xref table between user and project, with associated roles and permissions attributes. Should we change the name to "membership" or "member" or similar?
class Permission(AbstractBaseModel):
"""
Permission
"""
id = models.IntegerField(primary_key=True)
user_id = models.ForeignKey(User, on_delete=models.CASCADE)
project_Id = models.ForeignKey(Project, on_delete=models.CASCADE)
permission_type = models.ForeignKey(Project, on_delete=models.CASCADE)
granted = models.DateTimeField()
ended = models.DateTimeField()
def __str__(self):
return f"{self.name}"
Update for the record: according to @ExperimentsInHonesty during a meeting, this is not a membership junction table between user and project. It's a property relating to user. There's an optional reference to project if it makes sense to have it. Where it doesn't make sense is for a brigade admin role which has permission to all projects under that brigade.
This issue (or a closely-related new issue) requires some research into the best way to implement permissions in django.
ERD/SS To-do: replace role_id with practice_area_id
remove relationship between role and permission tables
add relationship between practice_area and permission tables
Discussion for these changes happened here: https://github.com/hackforla/peopledepot/discussions/170
Dependency
148
Overview
We need to create the user permission table so that we can update a shared data store across hackforla.org, vrms, civictechjobs, and tables (onboarding) project.
Details
A table and a model are the same thing
Action Items
Resources/Instructions
Items to document (referenced above)
Description
Data Fields
Copied from spreadsheet and checked off according to ERD. Data fields are bolded and relation fields are not. (unchecked items indicate a mismatch between ERD and spreadsheet, which requires a review)
In ERD only (having items here indicates a mismatch, which requires a review)
Associated Tables
Copied from spreadsheet and checked off according to ERD (unchecked items indicate a mismatch between ERD and spreadsheet, which requires a review)
In ERD only (having items here indicates a mismatch, which requires a review)
Swagger Endpoint Link
-