21 lines
461 B
Go
21 lines
461 B
Go
package usecase
|
|
|
|
import (
|
|
"context"
|
|
"time"
|
|
)
|
|
|
|
type RBACUseCase interface {
|
|
Check(ctx context.Context, role, path, method string) (CheckRolePermissionStatus, error)
|
|
LoadPolicy(ctx context.Context) error
|
|
SyncPolicy(ctx context.Context, cron time.Duration)
|
|
}
|
|
|
|
type CheckRolePermissionStatus struct {
|
|
Allow bool `json:"allow"`
|
|
Select struct {
|
|
PermissionName string `json:"permission_name"`
|
|
PlainCode bool `json:"plain_code"`
|
|
} `json:"select"`
|
|
}
|