mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-03 23:20:26 +08:00
优化接口权限
This commit is contained in:
@@ -16,7 +16,7 @@ type ACMEProviderAccountService struct {
|
||||
|
||||
// CreateACMEProviderAccount 创建服务商账号
|
||||
func (this *ACMEProviderAccountService) CreateACMEProviderAccount(ctx context.Context, req *pb.CreateACMEProviderAccountRequest) (*pb.CreateACMEProviderAccountResponse, error) {
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx)
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -33,7 +33,7 @@ func (this *ACMEProviderAccountService) CreateACMEProviderAccount(ctx context.Co
|
||||
|
||||
// FindAllACMEProviderAccountsWithProviderCode 使用代号查找服务商账号
|
||||
func (this *ACMEProviderAccountService) FindAllACMEProviderAccountsWithProviderCode(ctx context.Context, req *pb.FindAllACMEProviderAccountsWithProviderCodeRequest) (*pb.FindAllACMEProviderAccountsWithProviderCodeResponse, error) {
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx)
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -76,7 +76,7 @@ func (this *ACMEProviderAccountService) FindAllACMEProviderAccountsWithProviderC
|
||||
|
||||
// UpdateACMEProviderAccount 修改服务商账号
|
||||
func (this *ACMEProviderAccountService) UpdateACMEProviderAccount(ctx context.Context, req *pb.UpdateACMEProviderAccountRequest) (*pb.RPCSuccess, error) {
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx)
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -100,7 +100,7 @@ func (this *ACMEProviderAccountService) UpdateACMEProviderAccount(ctx context.Co
|
||||
|
||||
// DeleteACMEProviderAccount 删除服务商账号
|
||||
func (this *ACMEProviderAccountService) DeleteACMEProviderAccount(ctx context.Context, req *pb.DeleteACMEProviderAccountRequest) (*pb.RPCSuccess, error) {
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx)
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -124,7 +124,7 @@ func (this *ACMEProviderAccountService) DeleteACMEProviderAccount(ctx context.Co
|
||||
|
||||
// FindEnabledACMEProviderAccount 查找单个服务商账号
|
||||
func (this *ACMEProviderAccountService) FindEnabledACMEProviderAccount(ctx context.Context, req *pb.FindEnabledACMEProviderAccountRequest) (*pb.FindEnabledACMEProviderAccountResponse, error) {
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx)
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -174,7 +174,7 @@ func (this *ACMEProviderAccountService) FindEnabledACMEProviderAccount(ctx conte
|
||||
|
||||
// CountAllEnabledACMEProviderAccounts 计算所有服务商账号数量
|
||||
func (this *ACMEProviderAccountService) CountAllEnabledACMEProviderAccounts(ctx context.Context, req *pb.CountAllEnabledACMEProviderAccountsRequest) (*pb.RPCCountResponse, error) {
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx)
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -189,7 +189,7 @@ func (this *ACMEProviderAccountService) CountAllEnabledACMEProviderAccounts(ctx
|
||||
|
||||
// ListEnabledACMEProviderAccounts 列出单页服务商账号
|
||||
func (this *ACMEProviderAccountService) ListEnabledACMEProviderAccounts(ctx context.Context, req *pb.ListEnabledACMEProviderAccountsRequest) (*pb.ListEnabledACMEProviderAccountsResponse, error) {
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx)
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user