用户角色菜单接口取消对权限标识的判断
This commit is contained in:
@@ -26,68 +26,52 @@ func Routers() []services.RouterItem {
|
||||
|
||||
rs := [...]services.RouterItem{
|
||||
{
|
||||
Method: "GET",
|
||||
Pattern: "/roles",
|
||||
Handler: apis.List,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:menu:list"},
|
||||
}),
|
||||
Method: "GET",
|
||||
Pattern: "/roles",
|
||||
Handler: apis.List,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
{
|
||||
Method: "GET",
|
||||
Pattern: "/role/{roleId}",
|
||||
Handler: apis.Info,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:menu:query"},
|
||||
}),
|
||||
Method: "GET",
|
||||
Pattern: "/role/{roleId}",
|
||||
Handler: apis.Info,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
{
|
||||
Method: "POST",
|
||||
Pattern: "/role",
|
||||
Handler: apis.Add,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:menu:add"},
|
||||
}),
|
||||
Method: "POST",
|
||||
Pattern: "/role",
|
||||
Handler: apis.Add,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
{
|
||||
Method: "PUT",
|
||||
Pattern: "/role",
|
||||
Handler: apis.Edit,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:menu:edit"},
|
||||
}),
|
||||
Method: "PUT",
|
||||
Pattern: "/role",
|
||||
Handler: apis.Edit,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
{
|
||||
Method: "DELETE",
|
||||
Pattern: "/role/{roleIds}",
|
||||
Handler: apis.Remove,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:menu:edit"},
|
||||
}),
|
||||
Method: "DELETE",
|
||||
Pattern: "/role/{roleIds}",
|
||||
Handler: apis.Remove,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
{
|
||||
Method: "PUT",
|
||||
Pattern: "/role/changeStatus",
|
||||
Handler: apis.Status,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:role:edit"},
|
||||
}),
|
||||
Method: "PUT",
|
||||
Pattern: "/role/changeStatus",
|
||||
Handler: apis.Status,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
{
|
||||
Method: "GET",
|
||||
Pattern: "/role/authUser/allocatedList",
|
||||
Handler: apis.AuthUserAllocatedList,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:user:list"},
|
||||
}),
|
||||
Method: "GET",
|
||||
Pattern: "/role/authUser/allocatedList",
|
||||
Handler: apis.AuthUserAllocatedList,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
{
|
||||
Method: "PUT",
|
||||
Pattern: "/role/authUser/checked",
|
||||
Handler: apis.AuthUserChecked,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:role:edit"},
|
||||
}),
|
||||
Method: "PUT",
|
||||
Pattern: "/role/authUser/checked",
|
||||
Handler: apis.AuthUserChecked,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
// 添加更多的 Router 对象...
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user