角色授權頁面顯示

2021-10-10 07:52:37 字數 4366 閱讀 9322

//根據角色id查詢出角色的資訊,將角色資訊其存入model中,在頁面可以使用$去處儲存的角色資訊

(path =

"torolemodule"

,method =

)public string torolemodule

(string roleid,model model)

//需要先查詢出的當前角色的擁有的模組以及所有的模組資訊,然後判斷使用者是否擁有所有模組中的一些模組,

//如果他擁有模組,就在返回給頁面的json串中的乙個物件裡面新增checked屬性,讓他預設勾選上。

**rolecontroller*

*(path=

"/getztreedata"

,method =

)public

@responsebody

object getztreedata

(string roleid)

, list

> list =

newarraylist

<

>()

; list

modules = moduleservice.

findrolemoudule

(roleid)

;//返回給頁面

for(module m:modulelist)

//新增到集合中

list.

add(node);}

return list;

//@responsebody將list轉成json

}

查詢當前角色的許可權

roleserviceimpl(service介面實現類)

@override

public role findbyrid

(string s)

moduleserviceimpl(service介面實現類)

@override

public list

findallmodule()

@override

public list

findrolemoudule

(string rid)

roledao(inte***ce)

role findone

(string s)

;

moduledao(inte***ce)

list

findall()

; list

findone

(string rid)

;

roledao.xml

"findone"

parametertype

="string"

resultmap

="rolemap"

>

select * from pe_role where role_id=#

select

>

"rolemap"

type

="role"

>

property

="roleid"

column

="role_id"

/>

property

="name"

column

="name"

/>

property

="remark"

column

="remark"

/>

property

="orderno"

column

="order_no"

/>

property

="createby"

column

="create_by"

/>

property

="createdept"

column

="create_dept"

/>

property

="createtime"

column

="create_time"

/>

property

="updateby"

column

="update_by"

/>

property

="updatetime"

column

="update_time"

/>

property

="companyid"

column

="company_id"

/>

property

="companyname"

column

="company_name"

/>

resultmap

>

moduledao.xml

"findall"

resultmap

="modulemap"

>

select * from ss_module

select

>

"findone"

parametertype

="string"

resultmap

="modulemap"

>

select m.*

from pe_role_module rm join ss_module m

on rm.module_id = m.module_id

where role_id=#

select

>

"modulemap"

type

="module"

>

column

="module_id"

property

="moduleid"

/>

column

="parent_id"

property

="parentid"

/>

column

="parent_name"

property

="parentname"

/>

column

="name"

property

="name"

/>

column

="layer_num"

property

="layernum"

/>

column

="is_leaf"

property

="isleaf"

/>

column

="ico"

property

="ico"

/>

column

="cpermission"

property

="cpermission"

/>

column

="curl"

property

="curl"

/>

column

="ctype"

property

="ctype"

/>

column

="state"

property

="state"

/>

column

="belong"

property

="belong"

/>

column

="cwhich"

property

="cwhich"

/>

column

="quote_num"

property

="quotenum"

/>

column

="remark"

property

="remark"

/>

column

="order_no"

property

="orderno"

/>

resultmap

>

mongdb角色的授權

開啟cmd視窗切換到cd d programs mongodb bin d programs mongodb bin mongo mongodb shell version v3.4.6connecting to mongodb mongodb server version 3.4.3 use ad...

Oracle 角色授權與安全

oracle與作業系統整合,在xp中建立ora dba組,並將安裝使用者加入該組,使之成為dba,因此在sqlplus中,普通使用者tom 可以用 connect tom tomcat as sysdba 登入,也可以如下登入 connect as sysdba 建立使用者 oracle不支援先輸數...

Oracle新建使用者 角色 授權

使用管理員使用者登入oracle sqlplus nolog conn as sysdba 建立使用者 create user 使用者名稱 identified by 密碼 quota 空間 on uses 或者 create user 使用者名稱 identified by 密碼 刪除使用者 dr...