当前位置: 首页>>代码示例>>Python>>正文


Python AuthorPermissionLogic.has_perm方法代码示例

本文整理汇总了Python中permission.logics.AuthorPermissionLogic.has_perm方法的典型用法代码示例。如果您正苦于以下问题:Python AuthorPermissionLogic.has_perm方法的具体用法?Python AuthorPermissionLogic.has_perm怎么用?Python AuthorPermissionLogic.has_perm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在permission.logics.AuthorPermissionLogic的用法示例。


在下文中一共展示了AuthorPermissionLogic.has_perm方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_has_perm_change_with_obj

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_change_with_obj(self):
     permission_logic = AuthorPermissionLogic()
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertFalse(
             permission_logic.has_perm(self.user1, self.perm2, self.article))
开发者ID:AmbientLighter,项目名称:django-permission,代码行数:7,代码来源:test_author.py

示例2: test_has_perm_delete_without_obj

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_delete_without_obj(self):
     permission_logic = AuthorPermissionLogic()
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertTrue(permission_logic.has_perm(self.user1, self.perm3))
开发者ID:AmbientLighter,项目名称:django-permission,代码行数:6,代码来源:test_author.py

示例3: test_has_perm_delete_without_obj_with_anonymous

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_delete_without_obj_with_anonymous(self):
     permission_logic = AuthorPermissionLogic()
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertFalse(permission_logic.has_perm(self.anonymous, self.perm3))
开发者ID:AmbientLighter,项目名称:django-permission,代码行数:6,代码来源:test_author.py

示例4: test_has_perm_add_with_obj_author_non_any_no_change

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_add_with_obj_author_non_any_no_change(self):
     permission_logic = AuthorPermissionLogic(any_permission=False,
                                              change_permission=False)
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertFalse(
             permission_logic.has_perm(self.user2, self.perm1, self.article))
开发者ID:AmbientLighter,项目名称:django-permission,代码行数:8,代码来源:test_author.py

示例5: test_has_perm_delete_with_obj_non_any_no_delete

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_delete_with_obj_non_any_no_delete(self):
     permission_logic = AuthorPermissionLogic(any_permission=False,
                                              delete_permission=False)
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertFalse(
             permission_logic.has_perm(self.user2, self.perm3, self.article))
开发者ID:AmbientLighter,项目名称:django-permission,代码行数:8,代码来源:test_author.py

示例6: test_has_perm_add_with_obj_author

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_add_with_obj_author(self):
     permission_logic = AuthorPermissionLogic()
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertTrue(
             permission_logic.has_perm(self.user2, self.perm1, self.article))
开发者ID:AmbientLighter,项目名称:django-permission,代码行数:7,代码来源:test_author.py

示例7: test_has_perm_delete_with_obj_author_diff_field_name

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_delete_with_obj_author_diff_field_name(self):
     permission_logic = AuthorPermissionLogic(field_name='editor')
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertFalse(
             permission_logic.has_perm(self.user2, self.perm3, self.article))
开发者ID:AmbientLighter,项目名称:django-permission,代码行数:7,代码来源:test_author.py

示例8: test_has_perm_delete_with_obj_author

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_delete_with_obj_author(self):
     permission_logic = AuthorPermissionLogic()
     self.assertTrue(
             permission_logic.has_perm(self.user2, self.perm3, self.article))
开发者ID:kingctan,项目名称:django-permission,代码行数:6,代码来源:test_author.py

示例9: test_has_perm_add_with_obj_author_diff_field_name

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_add_with_obj_author_diff_field_name(self):
     permission_logic = AuthorPermissionLogic(field_name='editor')
     self.assertFalse(
             permission_logic.has_perm(self.user2, self.perm1, self.article))
开发者ID:kingctan,项目名称:django-permission,代码行数:6,代码来源:test_author.py

示例10: test_has_perm_delete_with_obj

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_delete_with_obj(self):
     permission_logic = AuthorPermissionLogic()
     self.assertFalse(
             permission_logic.has_perm(self.user1, self.perm3, self.article))
开发者ID:kingctan,项目名称:django-permission,代码行数:6,代码来源:test_author.py

示例11: test_has_perm_change_without_obj

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_change_without_obj(self):
     permission_logic = AuthorPermissionLogic()
     self.assertFalse(permission_logic.has_perm(self.user1, self.perm2))
开发者ID:kingctan,项目名称:django-permission,代码行数:5,代码来源:test_author.py

示例12: test_has_perm_change_with_obj_author_non_any_no_delete

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_change_with_obj_author_non_any_no_delete(self):
     permission_logic = AuthorPermissionLogic(any_permission=False,
                                              delete_permission=False)
     self.assertTrue(
             permission_logic.has_perm(self.user2, self.perm2, self.article))
开发者ID:kingctan,项目名称:django-permission,代码行数:7,代码来源:test_author.py

示例13: test_has_perm_delete_with_obj_non_any

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_delete_with_obj_non_any(self):
     permission_logic = AuthorPermissionLogic(any_permission=False)
     self.assertTrue(
             permission_logic.has_perm(self.user2, self.perm3, self.article))
开发者ID:kingctan,项目名称:django-permission,代码行数:6,代码来源:test_author.py

示例14: test_has_perm_add_with_obj_author_non_any

# 需要导入模块: from permission.logics import AuthorPermissionLogic [as 别名]
# 或者: from permission.logics.AuthorPermissionLogic import has_perm [as 别名]
 def test_has_perm_add_with_obj_author_non_any(self):
     permission_logic = AuthorPermissionLogic(any_permission=False)
     self.assertFalse(
             permission_logic.has_perm(self.user2, self.perm1, self.article))
开发者ID:kingctan,项目名称:django-permission,代码行数:6,代码来源:test_author.py


注:本文中的permission.logics.AuthorPermissionLogic.has_perm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。