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":"用户",
|
"title":"用户",
|
||||||
"params": {
|
"params": {
|
||||||
"sortby":"username",
|
"sortby":"username",
|
||||||
|
"logined_userorgid":"orgid",
|
||||||
"browserfields": {
|
"browserfields": {
|
||||||
"exclouded": ["id"],
|
"exclouded": ["id", "password", "orgid", "nick_name" ],
|
||||||
"cwidth": {}
|
"cwidth": {}
|
||||||
},
|
},
|
||||||
"editexclouded": [
|
"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
|
return None
|
||||||
|
|
||||||
async def get_user_roles(userid):
|
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()
|
db = DBPools()
|
||||||
roles = []
|
roles = []
|
||||||
dbname = await get_dbname()
|
dbname = await get_dbname()
|
||||||
|
BIN
wwwroot/.DS_Store
vendored
BIN
wwwroot/.DS_Store
vendored
Binary file not shown.
@ -3,19 +3,23 @@
|
|||||||
"widgettype":"HBox",
|
"widgettype":"HBox",
|
||||||
"options":{
|
"options":{
|
||||||
"css":"clickable",
|
"css":"clickable",
|
||||||
"popup":{
|
"cwidth":14
|
||||||
"options":{
|
|
||||||
"auto_dismiss":true
|
|
||||||
},
|
|
||||||
"popup_desc":{
|
|
||||||
"widgettype":"urlwidget",
|
|
||||||
"options":{
|
|
||||||
"url":"{{entire_url('user_menu.ui')}}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"popup_event":"click"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
"binds":[
|
||||||
|
{
|
||||||
|
"wid":"self",
|
||||||
|
"event":"click",
|
||||||
|
"actiontype":"urlwidget",
|
||||||
|
"popup_options":{
|
||||||
|
"eventpos":true,
|
||||||
|
"dismiss_events":["command"]
|
||||||
|
},
|
||||||
|
"target":"Popup",
|
||||||
|
"options":{
|
||||||
|
"url":"{{entire_url('user_menu.ui')}}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
"subwidgets":[
|
"subwidgets":[
|
||||||
{
|
{
|
||||||
"widgettype":"Icon",
|
"widgettype":"Icon",
|
||||||
@ -28,7 +32,7 @@
|
|||||||
"widgettype":"Text",
|
"widgettype":"Text",
|
||||||
"options":{
|
"options":{
|
||||||
"wrap":false,
|
"wrap":false,
|
||||||
"text":"{{get_username()}}"
|
"text":"{{get_username()}}({{str(get_user_roles(get_user()))}})"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"widgettype":"Menu",
|
"widgettype":"Menu",
|
||||||
"options":{
|
"options":{
|
||||||
"target":"page_center",
|
"target":"PopupWindow",
|
||||||
"items":[
|
"items":[
|
||||||
{% if 'customer' in get_user_roles(get_user()) %}
|
{% if 'customer' in get_user_roles(get_user()) %}
|
||||||
{
|
{
|
||||||
@ -35,6 +35,11 @@
|
|||||||
"label":"重置密码",
|
"label":"重置密码",
|
||||||
"url":"{{entire_url('reset_password')}}"
|
"url":"{{entire_url('reset_password')}}"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name":"myrole",
|
||||||
|
"label":"我的角色",
|
||||||
|
"url":"{{entire_url('myrole.ui')}}"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name":"logout",
|
"name":"logout",
|
||||||
"label":"签退",
|
"label":"签退",
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
"id":"user_panel",
|
"id":"user_panel",
|
||||||
"widgettype":"VBox",
|
"widgettype":"VBox",
|
||||||
"options":{
|
"options":{
|
||||||
"width":"100px"
|
"width":"auto"
|
||||||
},
|
},
|
||||||
"subwidgets":[
|
"subwidgets":[
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user