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.
|
|
|
|
package role
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/veypi/vbase/auth"
|
|
|
|
|
"github.com/veypi/vigo"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var Router = vigo.NewRouter()
|
|
|
|
|
|
|
|
|
|
func init() {
|
refactor: Remove multi-tenant org system and simplify auth
- Delete org API endpoints (add_member, create, del, get, list, member, patch, tree)
- Delete models/org.go and remove Org/OrgMember models
- Delete org-related test files (org_crud, org_load_middleware, org_permission, multi_tenant)
- Delete org test scripts (03_org_permission.sh, 04_org_load_middleware.sh)
- Simplify auth/auth.go by removing org context and role loading logic
- Remove org claims from JWT tokens and login/register responses
- Redesign Permission model with hierarchical level-based access control
- Add auth/design.md with new permission system specification
- Update user and role APIs to work without org context
5 days ago
|
|
|
Router.Get("/", "List Roles", auth.VBaseAuth.PermRead("role"), list)
|
|
|
|
|
Router.Get("/{id}", "Get Role Detail", auth.VBaseAuth.PermRead("role"), get)
|
|
|
|
|
Router.Post("/", "Create Role", auth.VBaseAuth.PermCreate("role"), create)
|
|
|
|
|
Router.Patch("/{id}", "Update Role", auth.VBaseAuth.PermWrite("role"), patch)
|
|
|
|
|
Router.Delete("/{id}", "Delete Role", auth.VBaseAuth.PermWrite("role"), del)
|
|
|
|
|
Router.Get("/{id}/permissions", "Get Role Permissions", auth.VBaseAuth.PermRead("role"), getPermissions)
|
|
|
|
|
Router.Put("/{id}/permissions", "Update Role Permissions", auth.VBaseAuth.PermWrite("role"), updatePermissions)
|
|
|
|
|
}
|