样例,为下一步自定义用户权限作一下代码准备:
def get_context_data(self, **kwargs): if self.request.user.is_authenticated(): current_user_set = self.request.user print current_user_set current_group_set = Group.objects.get(user=current_user_set) print current_group_set print current_user_set.get_group_permissions() context = super(DeployVersionListView, self).get_context_data(**kwargs)
时间: 2024-10-16 09:22:53