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


Python Permission.brief方法代码示例

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


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

示例1: namedtuple

# 需要导入模块: from flask.ext.principal import Permission [as 别名]
# 或者: from flask.ext.principal.Permission import brief [as 别名]
# -*- coding: UTF-8 -*-
"""
@author: Yangminghua
@version: $
"""
from collections import namedtuple
from flask.ext.principal import Permission

WorkCommandManagement = namedtuple("work_command", ["method"])

ViewWorkCommand = WorkCommandManagement("view_work_command")
ScheduleWorkCommand = WorkCommandManagement("schedule_work_command")

view_work_command = Permission(ViewWorkCommand)
view_work_command.brief = u"查看工单的权限"
schedule_work_command = Permission(ScheduleWorkCommand)
schedule_work_command.brief = u"调度工单的权限"

if __name__ == "__main__":
    from litefac.permissions.order import ViewOrder ,ScheduleOrder
    print ViewWorkCommand == ViewOrder
    print ScheduleOrder == ScheduleWorkCommand
开发者ID:xiechao06,项目名称:litefac,代码行数:24,代码来源:work_command.py

示例2: Permission

# 需要导入模块: from flask.ext.principal import Permission [as 别名]
# 或者: from flask.ext.principal.Permission import brief [as 别名]
# -*- coding: utf-8 -*-
"""
基于角色的用户权限
"""

from flask.ext.principal import Permission, RoleNeed 
from lite_mms.constants import groups

DepartmentLeaderPermission = Permission(RoleNeed(unicode(groups.DEPARTMENT_LEADER)))
DepartmentLeaderPermission.brief = u"车间主任角色"
QualityInspectorPermission = Permission(RoleNeed(unicode(groups.QUALITY_INSPECTOR)))
QualityInspectorPermission.brief = u"质检员角色"
CargoClerkPermission = Permission(RoleNeed(unicode(groups.CARGO_CLERK)))
CargoClerkPermission.brief = u"收发员角色"
SchedulerPermission = Permission(RoleNeed(unicode(groups.SCHEDULER)))
SchedulerPermission.brief = u"调度员角色"
AccountantPermission = Permission(RoleNeed(unicode(groups.ACCOUNTANT)))
AccountantPermission.brief = u"财会人员角色"
AdminPermission = Permission(RoleNeed(unicode(groups.ADMINISTRATOR)))
AdminPermission.brief = u"管理员角色"
LoaderPermission = Permission(RoleNeed(unicode(groups.LOADER)))
LoaderPermission.brief = u'装卸工角色'
TeamLeaderPermission = Permission(RoleNeed(unicode(groups.TEAM_LEADER)))
TeamLeaderPermission.brief = u'班组长角色'
DepartmentLeaderPermission = Permission(RoleNeed(unicode(groups.DEPARTMENT_LEADER)))
DepartmentLeaderPermission.brief = u'车间主任角色'
QualityInspectorPermission = Permission(RoleNeed(unicode(groups.QUALITY_INSPECTOR)))
QualityInspectorPermission.brief = u'质检员角色'
开发者ID:PuZheng,项目名称:lite-mms,代码行数:30,代码来源:roles.py

示例3: namedtuple

# 需要导入模块: from flask.ext.principal import Permission [as 别名]
# 或者: from flask.ext.principal.Permission import brief [as 别名]
# -*- coding: utf-8 -*-
"""
针对订单对象的权限,将用户管理相关的权限
"""
from collections import namedtuple
from flask.ext.principal import Permission

SubOrderManagement = namedtuple("sub_order", ["method"])

EditSubOrderWeight = SubOrderManagement("edit_sub_order_weight")

edit_sub_order_weight = Permission(EditSubOrderWeight) 
edit_sub_order_weight.brief = u"修改子订单重量的权限"

OrderManagement = namedtuple("order", ["method"])
ViewOrder = OrderManagement("view_order")
ScheduleOrder = OrderManagement("schedule_order")

view_order = Permission(ViewOrder)
view_order.brief = u"查看订单的权限"
schedule_order = Permission(ScheduleOrder)
schedule_order.brief = u"调度订单的权限"
开发者ID:PuZheng,项目名称:lite-mms,代码行数:24,代码来源:order.py

示例4: namedtuple

# 需要导入模块: from flask.ext.principal import Permission [as 别名]
# 或者: from flask.ext.principal.Permission import brief [as 别名]
# -*- coding: UTF-8 -*-
from collections import namedtuple
from flask.ext.principal import Permission

DeductionManagement = namedtuple("deduction", ["method"])

ViewDeduction = DeductionManagement("view_deduction")

AddDeduction = DeductionManagement("add_deduction")

EditDeduction = DeductionManagement("edit_deduction")

DeleteDeduction = DeductionManagement("delete_deduction")

view_deduction = Permission(ViewDeduction)
view_deduction.brief = u"查看扣重的权限"

addDeduction = Permission(AddDeduction)
addDeduction.brief = u"增加扣重的权限"

editDeduction = Permission(EditDeduction)
editDeduction.brief = u'修改扣重的权限'

deleteDeduction = Permission(DeleteDeduction)
deleteDeduction.brief = u'删除扣重的权限'
开发者ID:PuZheng,项目名称:lite-mms,代码行数:27,代码来源:deduction.py

示例5: namedtuple

# 需要导入模块: from flask.ext.principal import Permission [as 别名]
# 或者: from flask.ext.principal.Permission import brief [as 别名]
# -*- coding: UTF-8 -*-

from collections import namedtuple
from flask.ext.principal import Permission

WorkFlowManagement = namedtuple("user", ["method"])

HandleNodeNeed = WorkFlowManagement('handle_node')

handle_node = Permission(HandleNodeNeed)
handle_node.brief = u'处理工作流的权限'

开发者ID:PuZheng,项目名称:lite-mms,代码行数:13,代码来源:work_flow.py

示例6: namedtuple

# 需要导入模块: from flask.ext.principal import Permission [as 别名]
# 或者: from flask.ext.principal.Permission import brief [as 别名]
# -*- coding: utf-8 -*-
"""
针对装卸货流程的权限管理
"""
from collections import namedtuple
from flask.ext.principal import Permission

UnloadSessionManagement = namedtuple("user", ["method"])

# 针对班组长的管理权限
EditUnloadSession = UnloadSessionManagement("edit_unload_session")
NewUnloadSession = UnloadSessionManagement("new_unload_session")

edit_us = Permission(EditUnloadSession)
edit_us.brief = u"修改卸货会话的权限"

new_us = Permission(NewUnloadSession)
new_us.brief = u"创建卸货会话的权限"
开发者ID:PuZheng,项目名称:lite-mms,代码行数:20,代码来源:cargo.py

示例7: namedtuple

# 需要导入模块: from flask.ext.principal import Permission [as 别名]
# 或者: from flask.ext.principal.Permission import brief [as 别名]
# -*- coding: UTF-8 -*-
from collections import namedtuple
from flask.ext.principal import Permission

DataManagement = namedtuple("data", ["method"])
ExportConsignment = DataManagement("export_consignment")

export_consignment = Permission(ExportConsignment)
export_consignment.brief = u"导出发货单的权限"

开发者ID:PuZheng,项目名称:lite-mms,代码行数:11,代码来源:data.py

示例8: namedtuple

# 需要导入模块: from flask.ext.principal import Permission [as 别名]
# 或者: from flask.ext.principal.Permission import brief [as 别名]
"""
针对用户对象的权限,将用户管理相关的权限
"""
from collections import namedtuple
from flask.ext.principal import Permission

AccountManagement = namedtuple("user", ["method"])

# 针对班组长的管理权限
ViewDepartmentLeader = AccountManagement("view_account")
EditDepartmentLeader = AccountManagement("edit_account")
NewDepartmentLeader = AccountManagement("new_account")
DelDepartmentLeader = AccountManagement("delete_account")

view_dl = Permission(ViewDepartmentLeader)
view_dl.brief = u"查看车间主任账户信息的权限"

edit_dl = Permission(EditDepartmentLeader)
edit_dl.brief = u"修改车间主任账户信息的权限"

new_dl = Permission(NewDepartmentLeader)
new_dl.brief = u"创建车间主任账户的权限"

del_dl = Permission(DelDepartmentLeader)
del_dl.brief = u"删除车间主任账户的权限"

admin_dl = Permission(ViewDepartmentLeader, EditDepartmentLeader, 
                     NewDepartmentLeader, DelDepartmentLeader)
admin_dl.brief = u"对车间主任帐号有增删改查权限"

if __name__ == "__main__":
开发者ID:PuZheng,项目名称:lite-mms,代码行数:33,代码来源:accounts.py


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