89 lines
2.7 KiB
Python
89 lines
2.7 KiB
Python
"""商家子客服权限码与常量(码表冻结,只增不改)。"""
|
|
|
|
CLUB_ID_DEFAULT = 'xq'
|
|
|
|
MEMBER_STATUS_ACTIVE = 1
|
|
MEMBER_STATUS_DISABLED = 0
|
|
MEMBER_STATUS_REMOVED = 2
|
|
|
|
INVITE_STATUS_UNUSED = 0
|
|
INVITE_STATUS_USED = 1
|
|
INVITE_STATUS_REVOKED = 2
|
|
INVITE_STATUS_EXPIRED = 3
|
|
|
|
ACTOR_MERCHANT = 'MERCHANT'
|
|
ACTOR_STAFF = 'STAFF'
|
|
|
|
WALLET_ALLOCATE = 'ALLOCATE'
|
|
WALLET_DISPATCH_FREEZE = 'DISPATCH_FREEZE'
|
|
WALLET_DISPATCH_CONFIRM = 'DISPATCH_CONFIRM'
|
|
WALLET_REFUND_RELEASE = 'REFUND_RELEASE'
|
|
WALLET_REVOKE = 'REVOKE'
|
|
WALLET_ADJUST = 'ADJUST'
|
|
|
|
STAT_ACTION_DISPATCH = 1
|
|
STAT_ACTION_SETTLE = 2
|
|
STAT_ACTION_REFUND = 3
|
|
|
|
# perm_code -> 中文名
|
|
PERMISSION_DEFINITIONS = [
|
|
('staff_manage', '子客服管理'),
|
|
('role_manage', '角色管理'),
|
|
('wallet_allocate', '划额度'),
|
|
('wallet_view', '查看额度'),
|
|
('finance_view', '查看商家余额'),
|
|
('order_dispatch', '派单发单'),
|
|
('order_view_all', '查看全部订单'),
|
|
('order_view_self', '只看自己派的单'),
|
|
('order_detail', '订单详情'),
|
|
('order_settle', '结单'),
|
|
('order_refund_apply', '申请退款'),
|
|
('order_cancel', '撤销订单'),
|
|
('order_change_player', '换打手'),
|
|
('penalty_apply', '申请罚单'),
|
|
('penalty_manage', '改撤罚单'),
|
|
('penalty_view', '查看罚单'),
|
|
('dashou_ban', '封禁解封打手'),
|
|
('template_manage', '派单模板'),
|
|
('audit_view', '操作日志'),
|
|
('rank_view', '客服排行榜'),
|
|
('im_chat', '订单IM'),
|
|
('stats_view', '统计数据'),
|
|
]
|
|
|
|
# 系统预置角色 -> 默认权限
|
|
SYSTEM_ROLE_TEMPLATES = [
|
|
{
|
|
'role_code': 'CHIEF',
|
|
'role_name': '总管',
|
|
'sort_order': 100,
|
|
'permissions': [
|
|
'staff_manage', 'wallet_allocate', 'wallet_view', 'finance_view',
|
|
'order_dispatch', 'order_view_all', 'order_detail', 'order_settle',
|
|
'order_refund_apply', 'order_cancel', 'order_change_player',
|
|
'penalty_apply', 'penalty_manage', 'penalty_view', 'dashou_ban',
|
|
'template_manage', 'audit_view', 'rank_view', 'im_chat', 'stats_view',
|
|
],
|
|
},
|
|
{
|
|
'role_code': 'FINANCE',
|
|
'role_name': '财务',
|
|
'sort_order': 80,
|
|
'permissions': [
|
|
'wallet_allocate', 'wallet_view', 'finance_view', 'order_view_all',
|
|
'order_detail', 'penalty_view', 'audit_view', 'rank_view', 'stats_view',
|
|
],
|
|
},
|
|
{
|
|
'role_code': 'DISPATCHER',
|
|
'role_name': '派单员',
|
|
'sort_order': 60,
|
|
'permissions': [
|
|
'wallet_view', 'order_dispatch', 'order_view_self', 'order_detail',
|
|
'rank_view', 'im_chat', 'stats_view',
|
|
],
|
|
},
|
|
]
|
|
|
|
OWNER_ALL_PERMISSIONS = [code for code, _ in PERMISSION_DEFINITIONS]
|