简体   繁体   中英

Why user permissions are not showing in Django Rest Framework?

I am creating a group, added permissions to that group and assigning that group to a user (as shown in below code):

new_group, created = Group.objects.get_or_create(name=grp_name)
permission_obj = Permission.objects.get(name=permission)
new_group.permissions.add(permission_obj)
user.groups.add(new_group)

This code works properly but in admin interface the 'user permissions' section is not showing added group permissions

在此处输入图像描述

If you assign permissions using a group, they do not show in the "User Permissions" section. That section is only for assigning individual permissions to one user, rather than using groups which are better suited to applying multiple permissions to many users.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM