# zrdops4 **Repository Path**: cucy/zrdops4 ## Basic Information - **Project Name**: zrdops4 - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2017-08-12 - **Last Updated**: 2020-12-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # zrdops4 ## 权限 ```python In [1]: from django.contrib.auth.models import User # 导入用户 In [4]: from django.contrib.auth.models import Permission # 导入权限 In [2]: user = User.objects.get(username='admin') # 查看所有权限 In [3]: user.user_permissions.all() Out[3]: [] # 删除权限 In [5]: user.user_permissions.remove(Permission.objects.get(pk=23)) # 添加权限 In [7]: user.user_permissions.add(Permission.objects.get(pk=28)) In [8]: user.user_permissions.all() Out[8]: [] ```