Re: how to display group and create user permission in templates?

2024-02-20 Thread ABDUL HAFEEZ
much appreciated On Tuesday, February 20, 2024 at 7:55:47 AM UTC+5 Ryan Nowakowski wrote: > On Mon, Feb 19, 2024 at 02:16:29AM -0800, ABDUL HAFEEZ wrote: > > Hell all how to display *createsuperuser *and there permission in > *templates > > *instead of admin dashboard > > Users and

how to display group and create user permission in templates?

2024-02-19 Thread ABDUL HAFEEZ
Hell all how to display *createsuperuser *and there permission in *templates *instead of admin dashboard -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to

Django user permission edit in custom dashboard

2019-09-09 Thread Santosh Rana Magar
Hello Everyone, How to achieve django admin site( below picture) user permission field in custom dashboard [image: h0H8Q.png] -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving e

Re: Set user permission via python

2019-04-11 Thread Nelson Varela
Correction: u, created = User.objects.get_or_create(username="user_name", defaults={' email': 'user...@example.com', 'password': 'blah'}) -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails

Re: Set user permission via python

2019-04-11 Thread Nelson Varela
Glad you've found the solution. One thing I wanted to advice you is to use the get_or_create method on User. For more detail check the django documentation. So: u, created = User.objects.get_or_create(username="user_name", defaults={ email='user...@example.com', password='blah'}) -- You

Re: Set user permission via python

2019-04-10 Thread Matt Collins
b.auth.models import User > user_name = User.objects.get(username="user_name") > user_name.get_all_permissions() > set([u'display_data.settings']) > > > I'm trying to set this permission for the user with the following: > > from django.contrib.auth import get_user_m

Set user permission via python

2019-04-09 Thread matt
bjects.get(username="user_name") user_name.get_all_permissions() set([u'display_data.settings']) I'm trying to set this permission for the user with the following: from django.contrib.auth import get_user_model from django.contrib.auth.models import User, Permission User = get_user_mo

Re: Remove user permission

2018-12-03 Thread Saurabh Agrawal
"user.user_permissions.remove" expects a permission object. Or the pk of that object. Hence, the TypeError. On Mon, Dec 3, 2018 at 9:02 PM Gaurav Tomer wrote: > I was trying to remove permission of a user using remove utility as below - > > user = User.objects.get(id=user_id) >

Remove user permission

2018-12-03 Thread Gaurav Tomer
I was trying to remove permission of a user using remove utility as below - user = User.objects.get(id=user_id) user.user_permissions.remove("delete_polls") Then it raises TypeError:invalid literal for int with base 10: 'delete_polls' Do I need to pass index here? As it sounds kind of static

Re: ManyToMany widget in admin - the "user - permission way.."

2017-11-28 Thread Matemática A3K
> > I have this error: > > Unhandled exception in thread started by check_errors..wrapper at 0x7f2fa8d646a8> > > Traceback (most recent call last): > > File "/usr/local/lib/python3.5/dist-packages/django/utils/autoreload.py", > line 228, in wrapper > > fn(*args, **kwargs) > > File

Re: ManyToMany widget in admin - the "user - permission way.."

2017-11-28 Thread Allan Nava
Il giorno venerdì 27 febbraio 2009 15:14:13 UTC+1, Daniel Roseman ha scritto: > > On Feb 27, 1:21 pm, Anders wrote: > > Hi. > > > > In the users admin of Django admin there is a nice way of selecting > > permissions for each user by adding and removing

Checking user permission denied in Django Selenium tests

2015-07-29 Thread Cherie Pun
On the local server that I start up, if the user does not have the required permission for a particular view, they will be redirected to the 403 page (I am using the permission_required decorator) However, in the selenium test, the PermissionDenied exception is thrown and the user is

Add chosen user Permission in User table from Avaliable user Permissions by writing code

2012-12-06 Thread Nikhil Verma
Hi All I am in User Table from django auth and in the admin i am in change_forms page . I can clearly see that there is ManyToMany relationship field called user_permission. In user_permission filed we have choosen user permssion in which we choosen permission gets saved. However i want to set

Re: User permission

2012-03-07 Thread Andre Terra
What I do: 1) Control user rights in views, always, no matter what. 2) Pass user perms to template so that you only display accessible, permitted links. Cheers, AT On Wed, Mar 7, 2012 at 2:10 PM, Xavier Pegenaute wrote: > Hi, > > Which one is the best option? > > a-

User permission

2012-03-07 Thread Xavier Pegenaute
Hi, Which one is the best option? a- Control the user rights in the views b- Control the user rights in the templates c- Control the user rights in both locations I guess is (c), but it's too much work. Thanks, Regards. -- You received this message because you are subscribed to the Google

Re: restrict downloading files based on user-permission

2010-11-22 Thread patrickk
here´s a snippet which shows an implementation: http://djangosnippets.org/snippets/1710/ however, the only cross-browser solution I´ve come across is the one I ´ve posted above. regards, patrick On 22 Nov., 16:40, David De La Harpe Golden wrote: > Looked into

Re: restrict downloading files based on user-permission

2010-11-22 Thread David De La Harpe Golden
Looked into this a bit (will undoubtedly bite us soon): On 22/11/10 13:54, Torsten Bronger wrote: > Is there a standard at all for how non-ASCII in the header field > "Content-Disposition" is supposed to be encoded? The rfc5987 [1] based filename*=UTF-8''bl%c3%a4h mechanism very recently exists,

Re: restrict downloading files based on user-permission

2010-11-22 Thread Torsten Bronger
Hallöchen! patrickk writes: > well ... yes, but if someond uploads "äöü.PDF" I want the user to > download "äöü.PDF" again ... and not > %C3%83%C2%A4%C3%83%C2%B6%C3%83%C2%BC.PDF. > > did you test your code with IE7/IE8? I just did and the name of > the downloaded file differs from the upload.

Re: restrict downloading files based on user-permission

2010-11-21 Thread Łukasz Rekucki
I'm guessing that your original problem was that HTTP headers can only contain ASCII characters. To have a UTF-8 encoded name, you should use percent-encoding. I'm using this code on production site: quoted_name = urllib.quote(file.name.encode('utf-8')) response['Content-Disposition'] =

Re: restrict downloading files based on user-permission

2010-11-21 Thread patrickk
well ... yes, but if someond uploads "äöü.PDF" I want the user to download "äöü.PDF" again ... and not %C3%83%C2%A4%C3%83%C2%B6%C3%83%C2%BC.PDF. did you test your code with IE7/IE8? I just did and the name of the downloaded file differs from the upload. regards, patrick On 21 Nov., 20:39,

restrict downloading files based on user-permission

2010-11-21 Thread patrickk
I need to serve media-files uploaded by users, but only the user who uploaded a file should be able to download that file again. therefore, I need to check whether the currently logged-in user is the creator of that file (ok, that´s easy with using a view). – of course, serving the media-file via

Re: restrict downloading files based on user-permission

2010-11-21 Thread patrickk
just for the records ... it seems to work when filename is not defined with response["Content-Disposition"] = "attachment; filename=äöü &%%%.pdf" instead just use response["Content-Disposition"] = "attachment" and add the filename to the URL, e.g. /user/downloads/15/äöü &.pdf where 15 is the

Re: User permission confusing

2010-06-08 Thread adrian
> BTW: There are many links in the administration page, that I do not > know where to map. Such as "View on website" (http://127.0.0.1:8000/ > admin/r/3/2/) in an user profile of course including: http://docs.djangoproject.com/en/1.2/ref/models/instances/#get-absolute-url and

Re: User permission confusing

2010-06-08 Thread adrian
> BTW: There are many links in the administration page, that I do not > know where to map. Such as "View on website" (http://127.0.0.1:8000/ > admin/r/3/2/) in an user profile please read: http://docs.djangoproject.com/en/1.2/ref/models/instances/#the-permalink-decorator -- You received this

User permission confusing

2010-06-08 Thread stanleyxu2005
Hi All, I activated the admin module of django and I am now confused with the user permission. I logged in as administrator. I created an account "restricted_admin", activated "Staff status" and assigned "add/edit/delete user" permissions to him. Unexpecte

Re: ManyToMany widget in admin - the "user - permission way.."

2009-02-27 Thread Daniel Roseman
On Feb 27, 1:21 pm, Anders wrote: > Hi. > > In the users admin of Django admin there is a nice way of selecting > permissions for each user by adding and removing permissions from a > list of available permissions. () > > I have models set up similar to the

ManyToMany widget in admin - the "user - permission way.."

2009-02-27 Thread Anders
Hi. In the users admin of Django admin there is a nice way of selecting permissions for each user by adding and removing permissions from a list of available permissions. () I have models set up similar to the ones used for users and permissions, but I am not able to get the nice "select from

Adding various user permission to Forms having no models

2008-05-25 Thread Harish
hi friends. I am doing a project using djangoI created certain forms using view... now i want to add user permission to access those forms how i can do this? Regards Harish Bhat --~--~-~--~~~---~--~~ You received this message because you

User permission setting problem

2005-09-28 Thread Qiangning Hong
I setup a polls app following the tutorial and want to do more. I see there are users and groups settings in the admin index page, and so I want add a staff user to manage the polls. However, after I create the user, I found the available permissions list has nothing to do with polls management