def setup(identity): # 配置角色身份 identity.provides.add(RoleNeed('经理')) for section, actions in role_manager_section_action.items(): # 配置模块身份(用于模块显示) setup_section(identity, section) # 配置模块通用操作身份(用户动作权限) setup_section_action(identity, section, *actions)
def setup(identity): # 赋予整体角色权限 identity.provides.add(RoleNeed('系统')) for section, actions in role_administrator_section_action.items(): # 配置模块身份(用于模块显示) setup_section(identity, section) # 配置模块通用操作身份(用户动作权限) setup_section_action(identity, section, *actions)