Merge branch 'master' of git.kaiyuancloud.cn:yumoqing/rbac
This commit is contained in:
commit
b025495d4e
@ -1,22 +0,0 @@
|
||||
{
|
||||
"models_dir": "${HOME}$/py/rbac/models",
|
||||
"output_dir": "${HOME}$/py/sage/wwwroot/_a/userroles",
|
||||
"dbname": "sage",
|
||||
"tblname": "userroles",
|
||||
"title":"用户",
|
||||
"params": {
|
||||
"relation":{
|
||||
"outter_field":"roleid",
|
||||
"param_field":"userid"
|
||||
},
|
||||
"browserfields": {
|
||||
"exclouded": ["id", "userid"],
|
||||
"cwidth": {}
|
||||
},
|
||||
"editexclouded": [
|
||||
"id",
|
||||
"userid"
|
||||
],
|
||||
"record_toolbar": null
|
||||
}
|
||||
}
|
@ -6,13 +6,20 @@
|
||||
"title":"用户",
|
||||
"params": {
|
||||
"sortby":"username",
|
||||
"logined_userorgid":"orgid",
|
||||
"browserfields": {
|
||||
"exclouded": ["id"],
|
||||
"exclouded": ["id", "password", "orgid", "nick_name" ],
|
||||
"cwidth": {}
|
||||
},
|
||||
"editexclouded": [
|
||||
"id"
|
||||
"id", "nick_name", "orgid"
|
||||
],
|
||||
"record_toolbar": null
|
||||
"subtables": [
|
||||
{
|
||||
"field":"userid",
|
||||
"title":"用户角色",
|
||||
"subtable":"userrole"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ def get_apikey_from_token(token):
|
||||
return None
|
||||
|
||||
async def get_user_roles(userid):
|
||||
sql = "select b.name from userrole a, role b where a.userid=${userid}$ and a.roleid = b.id"
|
||||
sql = "select concat(b.orgtypeid, '.' b.name) as name from userrole a, role b where a.userid=${userid}$ and a.roleid = b.id"
|
||||
db = DBPools()
|
||||
roles = []
|
||||
dbname = await get_dbname()
|
||||
|
BIN
wwwroot/.DS_Store
vendored
BIN
wwwroot/.DS_Store
vendored
Binary file not shown.
@ -3,19 +3,23 @@
|
||||
"widgettype":"HBox",
|
||||
"options":{
|
||||
"css":"clickable",
|
||||
"popup":{
|
||||
"options":{
|
||||
"auto_dismiss":true
|
||||
},
|
||||
"popup_desc":{
|
||||
"widgettype":"urlwidget",
|
||||
"options":{
|
||||
"url":"{{entire_url('user_menu.ui')}}"
|
||||
}
|
||||
},
|
||||
"popup_event":"click"
|
||||
}
|
||||
"cwidth":14
|
||||
},
|
||||
"binds":[
|
||||
{
|
||||
"wid":"self",
|
||||
"event":"click",
|
||||
"actiontype":"urlwidget",
|
||||
"popup_options":{
|
||||
"eventpos":true,
|
||||
"dismiss_events":["command"]
|
||||
},
|
||||
"target":"Popup",
|
||||
"options":{
|
||||
"url":"{{entire_url('user_menu.ui')}}"
|
||||
}
|
||||
}
|
||||
],
|
||||
"subwidgets":[
|
||||
{
|
||||
"widgettype":"Icon",
|
||||
@ -28,7 +32,7 @@
|
||||
"widgettype":"Text",
|
||||
"options":{
|
||||
"wrap":false,
|
||||
"text":"{{get_username()}}"
|
||||
"text":"{{get_username()}}({{str(get_user_roles(get_user()))}})"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
"widgettype":"Menu",
|
||||
"options":{
|
||||
"target":"page_center",
|
||||
"target":"PopupWindow",
|
||||
"items":[
|
||||
{% if 'customer' in get_user_roles(get_user()) %}
|
||||
{
|
||||
@ -35,6 +35,11 @@
|
||||
"label":"重置密码",
|
||||
"url":"{{entire_url('reset_password')}}"
|
||||
},
|
||||
{
|
||||
"name":"myrole",
|
||||
"label":"我的角色",
|
||||
"url":"{{entire_url('myrole.ui')}}"
|
||||
},
|
||||
{
|
||||
"name":"logout",
|
||||
"label":"签退",
|
||||
|
@ -2,7 +2,7 @@
|
||||
"id":"user_panel",
|
||||
"widgettype":"VBox",
|
||||
"options":{
|
||||
"width":"100px"
|
||||
"width":"auto"
|
||||
},
|
||||
"subwidgets":[
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user