用户角色菜单接口取消对权限标识的判断
This commit is contained in:
@@ -28,44 +28,34 @@ func Routers() []services.RouterItem {
|
||||
|
||||
rs := [...]services.RouterItem{
|
||||
{
|
||||
Method: "GET",
|
||||
Pattern: "/users",
|
||||
Handler: apis.List,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:user:list"},
|
||||
}),
|
||||
Method: "GET",
|
||||
Pattern: "/users",
|
||||
Handler: apis.List,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
{
|
||||
Method: "GET",
|
||||
Pattern: "/user/{userId}",
|
||||
Handler: apis.Info,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:user:query"},
|
||||
}),
|
||||
Method: "GET",
|
||||
Pattern: "/user/{userId}",
|
||||
Handler: apis.Info,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
{
|
||||
Method: "POST",
|
||||
Pattern: "/user",
|
||||
Handler: apis.Add,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:user:add"},
|
||||
}),
|
||||
Method: "POST",
|
||||
Pattern: "/user",
|
||||
Handler: apis.Add,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
{
|
||||
Method: "PUT",
|
||||
Pattern: "/user",
|
||||
Handler: apis.Edit,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:user:edit"},
|
||||
}),
|
||||
Method: "PUT",
|
||||
Pattern: "/user",
|
||||
Handler: apis.Edit,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
{
|
||||
Method: "DELETE",
|
||||
Pattern: "/user/{userIds}",
|
||||
Handler: apis.Remove,
|
||||
Middleware: midware.Authorize(map[string][]string{
|
||||
"hasPerms": {"system:user:edit"},
|
||||
}),
|
||||
Method: "DELETE",
|
||||
Pattern: "/user/{userIds}",
|
||||
Handler: apis.Remove,
|
||||
Middleware: midware.Authorize(nil),
|
||||
},
|
||||
// 添加更多的 Router 对象...
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user