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


Python logics.CollaboratorsPermissionLogic类代码示例

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


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

示例1: test_has_perm_delete_with_obj

 def test_has_perm_delete_with_obj(self):
     permission_logic = CollaboratorsPermissionLogic()
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertFalse(
             permission_logic.has_perm(self.user1, self.perm3, self.article))
开发者ID:SalahAdDin,项目名称:django-permission,代码行数:5,代码来源:test_collaborators.py

示例2: test_has_perm_add_without_obj_with_anonymous

 def test_has_perm_add_without_obj_with_anonymous(self):
     permission_logic = CollaboratorsPermissionLogic()
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertFalse(permission_logic.has_perm(self.anonymous, self.perm1))
开发者ID:SalahAdDin,项目名称:django-permission,代码行数:4,代码来源:test_collaborators.py

示例3: test_has_perm_delete_with_obj_non_any_no_delete

 def test_has_perm_delete_with_obj_non_any_no_delete(self):
     permission_logic = CollaboratorsPermissionLogic(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:SalahAdDin,项目名称:django-permission,代码行数:6,代码来源:test_collaborators.py

示例4: test_has_perm_change_without_obj

 def test_has_perm_change_without_obj(self):
     permission_logic = CollaboratorsPermissionLogic()
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertTrue(permission_logic.has_perm(self.user1, self.perm2))
开发者ID:SalahAdDin,项目名称:django-permission,代码行数:4,代码来源:test_collaborators.py

示例5: test_has_perm_delete_with_obj_collaborators_diff_field_name

 def test_has_perm_delete_with_obj_collaborators_diff_field_name(self):
     permission_logic = CollaboratorsPermissionLogic(field_name='editors')
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertFalse(
             permission_logic.has_perm(self.user2, self.perm3, self.article))
开发者ID:SalahAdDin,项目名称:django-permission,代码行数:5,代码来源:test_collaborators.py

示例6: test_has_perm_add_with_obj_collaborators_non_any_no_change

 def test_has_perm_add_with_obj_collaborators_non_any_no_change(self):
     permission_logic = CollaboratorsPermissionLogic(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:SalahAdDin,项目名称:django-permission,代码行数:6,代码来源:test_collaborators.py

示例7: test_has_perm_add_with_obj_collaborators_diff_field_name

 def test_has_perm_add_with_obj_collaborators_diff_field_name(self):
     permission_logic = CollaboratorsPermissionLogic(field_name='editors')
     self.assertFalse(
             permission_logic.has_perm(self.user2, self.perm1, self.article))
开发者ID:kingctan,项目名称:django-permission,代码行数:4,代码来源:test_collaborators.py

示例8: test_has_perm_add_with_obj_collaborators

 def test_has_perm_add_with_obj_collaborators(self):
     permission_logic = CollaboratorsPermissionLogic()
     add_permission_logic(self.article.__class__, permission_logic)
     self.assertTrue(
             permission_logic.has_perm(self.user2, self.perm1, self.article))
开发者ID:SalahAdDin,项目名称:django-permission,代码行数:5,代码来源:test_collaborators.py

示例9: test_has_perm_delete_with_obj_collaborators

 def test_has_perm_delete_with_obj_collaborators(self):
     permission_logic = CollaboratorsPermissionLogic()
     self.assertTrue(
             permission_logic.has_perm(self.user2, self.perm3, self.article))
开发者ID:kingctan,项目名称:django-permission,代码行数:4,代码来源:test_collaborators.py

示例10: test_has_perm_change_with_obj

 def test_has_perm_change_with_obj(self):
     permission_logic = CollaboratorsPermissionLogic()
     self.assertFalse(
             permission_logic.has_perm(self.user1, self.perm2, self.article))
开发者ID:kingctan,项目名称:django-permission,代码行数:4,代码来源:test_collaborators.py

示例11: test_has_perm_delete_without_obj

 def test_has_perm_delete_without_obj(self):
     permission_logic = CollaboratorsPermissionLogic()
     self.assertFalse(permission_logic.has_perm(self.user1, self.perm3))
开发者ID:kingctan,项目名称:django-permission,代码行数:3,代码来源:test_collaborators.py

示例12: test_has_perm_change_with_obj_collaborators_non_any_no_delete

 def test_has_perm_change_with_obj_collaborators_non_any_no_delete(self):
     permission_logic = CollaboratorsPermissionLogic(any_permission=False,
                                              delete_permission=False)
     self.assertTrue(
             permission_logic.has_perm(self.user2, self.perm2, self.article))
开发者ID:kingctan,项目名称:django-permission,代码行数:5,代码来源:test_collaborators.py

示例13: test_has_perm_add_with_obj_collaborators_non_any

 def test_has_perm_add_with_obj_collaborators_non_any(self):
     permission_logic = CollaboratorsPermissionLogic(any_permission=False)
     self.assertFalse(
             permission_logic.has_perm(self.user2, self.perm1, self.article))
开发者ID:kingctan,项目名称:django-permission,代码行数:4,代码来源:test_collaborators.py


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