mml
This commit is contained in:
@@ -1484,14 +1484,14 @@ type permission struct {
|
||||
Object string `json:"object"`
|
||||
}
|
||||
|
||||
func IsPermissionAllowed(token, method, dbname, tbname string) (bool, error) {
|
||||
func IsPermissionAllowed(token, method, module, dbname, tbname string) (bool, error) {
|
||||
log.Info("IsPermissionAllowed processing... ")
|
||||
|
||||
exist, err := xEngine.Table("permission").
|
||||
Join("INNER", "role_permission", "permission.permission_name = role_permission.p_name").
|
||||
Join("INNER", "user_role", "role_permission.r_name = user_role.r_name").
|
||||
Join("INNER", "session", "user_role.u_name = session.account_id and session.access_token=?", token).
|
||||
Where("method in ('*',?) and element in ('*',?) and object in ('*',?)", method, dbname, tbname).
|
||||
Where("method in ('*',?) and management in ('*',?) and element in ('*',?) and object in ('*',?)", method, module, dbname, tbname).
|
||||
Exist()
|
||||
if err != nil {
|
||||
return false, err
|
||||
|
||||
Reference in New Issue
Block a user