personas Package¶
personas
Package¶
承認システム用カスタムユーザApp
filters
Module¶
perms
Module¶
-
class
kawaz.core.personas.perms.
AdamPermissionLogic
(any_permission=False, add_permission=False, change_permission=False, delete_permission=False)[ソース]¶ ベースクラス:
kawaz.core.personas.perms.BaseRolePermissionLogic
Permission logic class to allow permissions to over `Adam`(superuser) role user
-
role_names
= ['adam']¶
-
-
class
kawaz.core.personas.perms.
BaseRolePermissionLogic
(any_permission=False, add_permission=False, change_permission=False, delete_permission=False)[ソース]¶ ベースクラス:
permission.logics.base.PermissionLogic
Permission logic class for role based permission system It is checked by user_obj.role
-
has_perm
(user_obj, perm, obj=None)[ソース]¶ Check if user have permission (of object) It is determined from the user_obj.role.
If no object is specified, if any_permission is True it returns
True
. if else returnsFalse
.If an object is specified, it will return
True
if the user’s role is contained inrole_names
.パラメータ: - user_obj (django user model instance) – A django user model instance which be checked
- perm (string) – app_label.codename formatted permission string
- obj (None or django model instance) – None or django model instance for object permission
戻り値: Wheter the specified user have specified permission (of specified object).
戻り値の型: boolean
-
role_names
= []¶
-
-
class
kawaz.core.personas.perms.
ChildrenPermissionLogic
(any_permission=False, add_permission=False, change_permission=False, delete_permission=False)[ソース]¶ ベースクラス:
kawaz.core.personas.perms.BaseRolePermissionLogic
Permission logic class to allow permissions to over Children role user.
-
role_names
= ['adam', 'seele', 'nerv', 'children']¶
-
-
class
kawaz.core.personas.perms.
KawazAuthorPermissionLogic
(field_name=None, any_permission=None, change_permission=None, delete_permission=None)[ソース]¶ ベースクラス:
permission.logics.author.AuthorPermissionLogic
Kawaz用AuthorPermissionLogic
Kawazの仕様では、willeがauthorになることは現段階ではない。 通常のAuthorPermissionLogicを利用すると、willeであっても ログインユーザーであればモデルパーミッションがTrueになり 使い勝手が悪い そのため、wille以下の場合はFalseが返るようにした
-
role_names
= ['adam', 'seele', 'nerv', 'children']¶
-
-
class
kawaz.core.personas.perms.
NervPermissionLogic
(any_permission=False, add_permission=False, change_permission=False, delete_permission=False)[ソース]¶ ベースクラス:
kawaz.core.personas.perms.BaseRolePermissionLogic
Permission logic class to allow permissions to over `Nerv`(staff) role user
-
role_names
= ['adam', 'seele', 'nerv']¶
-
-
class
kawaz.core.personas.perms.
PersonaPermissionLogic
[ソース]¶ ベースクラス:
permission.logics.base.PermissionLogic
Permission logics which check the user’s role and return corresponding permission
-
class
kawaz.core.personas.perms.
SeelePermissionLogic
(any_permission=False, add_permission=False, change_permission=False, delete_permission=False)[ソース]¶ ベースクラス:
kawaz.core.personas.perms.BaseRolePermissionLogic
Permission logic class to allow permissions to over Seele role user.
-
role_names
= ['adam', 'seele']¶
-