-4

In my wen application i mad different login for different person like for HR ,for engineer ,for owner using django user creation form , and authenticate them using Django authentication ,now everything is work very well i am able to add user from the front add

but the problem is that everyone get same power and authority , i can change it from the admin penal but it will not be beneficial for my client/user I WANT ALLOW DIFFERENT KIND OF PERMISSIONS TO DIFFERENT GROUP OF USER(daynamicaliy with using django penal) show How can i do that. (i'm beginner so its request to all of you to give answer in some detail format) THANK YOU

Milan
  • 46
  • 7

1 Answers1

1

If you refer to the docs here, there is already a default system where you can add or remove permissions to a specific group of users. What you should do next is to create different subclasses for different types of users.

So your models will look something like this eventually:

class User(models.Model):
    # just keep whatever you had here

# Engineer and Manager will both be subclasses of User
class Engineer(User):
    # add whatever permissions you have

class Manager(User):
    # add different permissions

In this way, you will be able to apply custom permissions to different groups of people.

crimsonpython24
  • 2,223
  • 2
  • 11
  • 27