You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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:
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.
The text was updated successfully, but these errors were encountered: