Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
修复“角色管理:添加角色”报错
  • Loading branch information
4linuxfun committed Dec 8, 2022
commit ba94e3366bd75b2cc489385d758559d9d6e20c43
2 changes: 1 addition & 1 deletion server/crud/internal/roles.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def update_menus(self, session: Session, db_obj: Role, menus: List[int]):
casbin_enforcer.delete_permissions_for_user(f'role_{db_obj.id}')
logger.debug(db_menus)
for menu in db_menus:
if menu.auth is not None:
if (menu.auth is not None) and menu.auth:
model, act = menu.auth.split(':')
logger.debug(f'增加权限:role_{db_obj.id},{model},{act}')
casbin_enforcer.add_permission_for_user(f'role_{db_obj.id}', model, act)
Expand Down
2 changes: 1 addition & 1 deletion www/src/views/system/roles/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
id: null,
name: '',
description: '',
enable: ''
enable: true
})
console.log(selectRole)
dialogVisible.value = true
Expand Down