django-permissions

How to restrict Django users from filling a form twice in different sessions

How to restrict Django users from filling a form twice in different sessions Question: I have a form for employees to fill their bio data, I want to restrict the employees from viewing the form more than once. That is after filling the form, you can’t view the empty form anymore, you can only follow …

Total answers: 2

How to get the param PK in django restframework permission?

How to get the param PK in django restframework permission? Question: I have this permission in Django that look like this: class PermissionName(BasePermission): def has_object_permission(self, request, view, obj): if request.method in SAFE_METHODS: return True #I want to extract the pk or id params in here. return False Can anybody help me get the params of …

Total answers: 3

How to check (in template) if user belongs to a group

How to check (in template) if user belongs to a group Question: How to check in template whether user belongs to some group? It is possible in a view which is generating the template but what if I want to check this in base.html which is an extending template (it does not have it’s own …

Total answers: 11

Show group members in Django Admin

Show group members in Django Admin Question: Is it possible to set Django Admin page to show which user is in which group? And is it possible to be able to add a user into a group using the Django Admin page? If yes, how? Now, I’m adding programmatically customers into customers group and sellers …

Total answers: 2

Field Level Permission Django

Field Level Permission Django Question: Today i came up with a requirement where i need to implement field level permission so looking for the best possible way. class ABC(models.Model): field1 = ….. field2 = ….. field3 = ….. Create two groups(A and B) and assigned permission that both one can add/edit/delete and the other can …

Total answers: 4

How do I use Django groups and permissions?

How do I use Django groups and permissions? Question: I understand the basic user stuff. I know authentication, login, creating accounts, etc. But now I want to work on groups and permissions. Where is the documentation for django groups/permissions? This is not it: http://docs.djangoproject.com/en/dev/topics/auth/ Asked By: TIMEX || Source Answers: I suppose the first question …

Total answers: 1