Python django.contrib.auth.models 模块,PermissionsMixin() 实例源码

我们从Python开源项目中,提取了以下4个代码示例,用于说明如何使用django.contrib.auth.models.PermissionsMixin()

项目:django_wagtail_boilerplate    作者:AccentDesign    | 项目源码 | 文件源码
def test_base_class_is_permissions_mixin(self):
        self.assertTrue(issubclass(User, PermissionsMixin))

    ##################################
    # fields                         #
    ##################################
项目:api-django    作者:lafranceinsoumise    | 项目源码 | 文件源码
def has_perm(self, perm, obj=None):
        """
        Override PermissionsMixin has_perm to deactivate is_superuser if
        authenticated through a token
        """

        # Active superusers have all permissions.
        if self.is_active and self.is_superuser and not hasattr(self, 'token'):
            return True

        # Otherwise we need to check the backends.
        return _user_has_perm(self, perm, obj)
项目:django_oauth_boilerplate    作者:AccentDesign    | 项目源码 | 文件源码
def test_base_class_is_permissions_mixin(self):
        self.assertTrue(issubclass(User, PermissionsMixin))

    ##################################
    # fields                         #
    ##################################
项目:django_boilerplate    作者:AccentDesign    | 项目源码 | 文件源码
def test_base_class_is_permissions_mixin(self):
        self.assertTrue(issubclass(User, PermissionsMixin))

    ##################################
    # fields                         #
    ##################################