feat: automate business upgrades and sync reviewed frontend
This commit is contained in:
@@ -2,6 +2,7 @@ package system
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/go-kratos/kratos/v3/errors"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -32,6 +33,7 @@ type Authority struct {
|
||||
DeletedAt *time.Time
|
||||
AuthorityID uint
|
||||
AuthorityName string
|
||||
BusinessLevel *int
|
||||
ParentID *uint
|
||||
DataScope int
|
||||
DefaultRouter string
|
||||
@@ -39,6 +41,15 @@ type Authority struct {
|
||||
Menus []*Menu
|
||||
}
|
||||
|
||||
var ErrBusinessAuthorityProtected = errors.BadRequest("BUSINESS_AUTHORITY_PROTECTED", "商务内置角色不能删除")
|
||||
|
||||
func ValidateAuthorityDeletion(authority *Authority) error {
|
||||
if authority != nil && authority.BusinessLevel != nil {
|
||||
return ErrBusinessAuthorityProtected
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type AuthorityUsecase struct{ AuthorityAccessRepo }
|
||||
|
||||
func NewAuthorityUsecase(repo AuthorityAccessRepo) *AuthorityUsecase {
|
||||
|
||||
Reference in New Issue
Block a user