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

Django 1.11 user.has_perm doesn't work with CAS. #71

Open
jmartinz1 opened this issue Oct 4, 2017 · 0 comments
Open

Django 1.11 user.has_perm doesn't work with CAS. #71

jmartinz1 opened this issue Oct 4, 2017 · 0 comments

Comments

@jmartinz1
Copy link

Hello,

I have a problem using django-cas. when I try to use the Django has_perm method to authorize some access with user permissions in code. When I use the method has perm with Middleware and Auth Backend from CAS the method does not work as it should, it always returns False unless the user is superuser. could you please help me with this? . I try the same action deactivating CAS auth and using local Auth and the method work propertly.
Thanks in advance.

Django Version 1.11.4 and 1.11.5

Pdb without CAS client active (Local Auth).

(Pdb) user
<User: baseproject>
(Pdb) perm
'auth.pruebaapi'
(Pdb) user.user_permissions.all()[0]
<Permission: auth | permiso | pruebaapi>
(Pdb) user.user_permissions.all()[0].codename
'pruebaapi'
(Pdb) user.has_perm(perm)
True
(Pdb)

Pdb with Cas client active

(Pdb) user
<User: baseproject>
(Pdb) perm
'auth.pruebaapi'
(Pdb) user.user_permissions.all()[0]
<Permission: auth | permiso | pruebaapi>
(Pdb) user.user_permissions.all()[0].codename
'pruebaapi'
(Pdb) user.has_perm(perm)
False
(Pdb) Why ?

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