-
-
Notifications
You must be signed in to change notification settings - Fork 110
Open
Description
Hello,
I have a use case where the approver needs to be an "admin" of a team in order to approve joining requests. This means that only the admin of that specific team can approve requests.
Is that achievable using the permissions system?
My models look like:
class Team(model.Mode):
name = models.CharField(max_length=255)
admin = models.ForeignKey(User, on_delete=models.CASCADE)
class Role(models.Model):
# eg: admin, member
name = models.CharField(max_length=64, null=False, unique=True)
class Relationship(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE)
team = models.ForeignKey(Team, on_delete=models.CASCADE)
role = models.ForeignKey(Role, on_delete=models.CASCADE)
status = StateField(on_delete=models.CASCADE) # status can be pending, active or rejected
Once a user create a new team, they automatically have the relationship of admin which is approved. Then they can approve pending Relationships for their teams that they are admin of.
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels