vintasoftware / django-role-permissions

A django app for role based permissions.
http://django-role-permissions.readthedocs.org/
MIT License
728 stars 114 forks source link

Giving user a role from the admin pages doesn't update permissions? #130

Closed AliD201 closed 5 months ago

AliD201 commented 3 years ago

Hope you are doing well.

when registering a new user in this part

    form = UserRegisterForm(request.POST)
    if form.is_valid():
        form.save() # store the user 
        username = form.cleaned_data.get('username')
        messages.success(request,f'  {username}  account created succefully')
        return redirect('login')

and then adding a group to that user through the admin page. the user permissions doesn't change, Why is that ? i need to run sync_role for each user from the shell in order for it to sync

filipeximenes commented 3 years ago

Hi @AliD201, did you read through this section of the docs? https://django-role-permissions.readthedocs.io/en/stable/admin.html#rolepermissions-user-admin

vaishnavi-2901 commented 5 months ago

For that, you need to enable

ROLEPERMISSIONS_REGISTER_ADMIN = True

fjsj commented 5 months ago

Thanks, I imagine this is solved then. Closing.