When I do user.has_perm(), I get FALSE, but I have added permissions to
user manually with user.user_permissions.add(51) on the django
console/shell, and I even show all the permissions
with user.user_permissions.all(). (Also, if i
use user.has_perm('sdlfjksdf'), it returns FALSE rather than an error
saying that that permission does not exist, but that is another "issue").
user is active
DJANGO SHELL/CONSOLE
>>> user.has_perm('structures.edit_post')
False
>>> user.has_perm('structures.create_post')
False
>>> user.user_permissions.all()
[<Permission: auth | group | Can add group>, <Permission: auth | permission
| Can add permission>, <Permission: auth | permission | Can change
permission>, <Permission: auth | permission | Can delete permission>,
<Permission: structures | post | Can create new post>, <Permission:
structures | post | Can edit all users' posts>]
MYSQL: auth_permission
...
| 50 | Can delete post | 13 |
delete_post |
| 51 | Can create new post | 13 |
create_post |
| 52 | Can edit all users' posts | 13 |
edit_post |
+----+----------------------------------------------+-----------------+------------------------+
MYSQL: django_content_type
+----+--------------+--------------+--------------+
| id | name | app_label | model |
+----+--------------+--------------+--------------+
| 1 | permission | auth | permission |
| 2 | group | auth | group |
| 3 | user | auth | user |
| 4 | content type | contenttypes | contenttype |
| 5 | session | sessions | session |
| 6 | site | sites | site |
| 9 | category | structures | category |
| 10 | thread | structures | thread |
| 11 | bookmark | structures | bookmark |
| 12 | subscription | structures | subscription |
| 13 | post | structures | post |
+----+--------------+--------------+--------------+
--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/django-users/-/BEYgkvLkouEJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.