2022-09-27 17:59:05 +08:00
|
|
|
package schema
|
|
|
|
|
2023-05-25 15:56:58 +08:00
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
|
|
|
|
"github.com/answerdev/answer/internal/base/validator"
|
|
|
|
)
|
2022-09-27 17:59:05 +08:00
|
|
|
|
|
|
|
// PermissionMemberAction permission member action
|
|
|
|
type PermissionMemberAction struct {
|
|
|
|
Action string `json:"action"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
Type string `json:"type"`
|
|
|
|
}
|
2023-05-25 15:56:58 +08:00
|
|
|
|
|
|
|
// GetPermissionReq get permission request
|
|
|
|
type GetPermissionReq struct {
|
|
|
|
Action string `form:"action"`
|
|
|
|
Actions []string `validate:"omitempty" form:"actions"`
|
|
|
|
}
|
|
|
|
|
|
|
|
func (r *GetPermissionReq) Check() (errField []*validator.FormErrorField, err error) {
|
|
|
|
if len(r.Action) > 0 {
|
|
|
|
r.Actions = strings.Split(r.Action, ",")
|
|
|
|
}
|
|
|
|
return nil, nil
|
|
|
|
}
|