mirror of https://github.com/veypi/OneAuth.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
739 B
Go
19 lines
739 B
Go
|
1 week ago
|
package role
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/veypi/vbase/auth"
|
||
|
|
"github.com/veypi/vigo"
|
||
|
|
)
|
||
|
|
|
||
|
|
var Router = vigo.NewRouter()
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
Router.Get("/", "List Roles", auth.VBaseAuth.Perm("role:read"), list)
|
||
|
|
Router.Get("/{id}", "Get Role Detail", auth.VBaseAuth.Perm("role:read"), get)
|
||
|
|
Router.Post("/", "Create Role", auth.VBaseAuth.Perm("role:create"), create)
|
||
|
|
Router.Patch("/{id}", "Update Role", auth.VBaseAuth.Perm("role:update"), patch)
|
||
|
|
Router.Delete("/{id}", "Delete Role", auth.VBaseAuth.Perm("role:delete"), del)
|
||
|
|
Router.Get("/{id}/permissions", "Get Role Permissions", auth.VBaseAuth.Perm("role:read"), getPermissions)
|
||
|
|
Router.Put("/{id}/permissions", "Update Role Permissions", auth.VBaseAuth.Perm("role:update"), updatePermissions)
|
||
|
|
}
|