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

Role management #275

Open
RignonNoel opened this issue Dec 30, 2020 · 0 comments
Open

Role management #275

RignonNoel opened this issue Dec 30, 2020 · 0 comments

Comments

@RignonNoel
Copy link
Contributor

RignonNoel commented Dec 30, 2020

We want to add a new feature allowing administrator to create Role that they can assign to Users, each role will contain a set of permissions that we can use on the Cell we are linked to.

Expected behavior

  • Administrators can manage Role (create/update/delete)
  • Administrators can link some permissions to a Role
  • Administrators can link a User to a Cell with a given Role
  • Administrators can remove link between a User and a Cell

Current behavior

Only administrators can manage Cell for the moment and it's a problem since some administrators should not have the right to manage ALL the Cell

Potential solution

Here is a potential UML diagram for the solution:

plantuml

Here is an example of role model that can be used:

class Role(models.Model):

    PERMISSION_A = 'permission_a'
    PERMISSION_B = 'permission_b'
    
    PERMISSION_CHOICES = [
        (PERMISSION_A, 'Permission A'),
        (PERMISSION_B, 'Permission B'),
    ]

    name = models.CharField(
        max_length=100,
        blank=False,
        null=False,
        verbose_name=_("Name"),
    )

    permissions = MultiSelectField(
        choices=PERMISSION_CHOICES,
        verbose_name=_('Permissions'),
        blank=True,
        null=True
    )

    def __str__(self):
        return self.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant