优化接口权限

This commit is contained in:
GoEdgeLab
2022-09-17 16:07:37 +08:00
parent 26c32e0621
commit 6aafa656a6
54 changed files with 275 additions and 246 deletions

View File

@@ -17,7 +17,7 @@ type HTTPFastcgiService struct {
// CreateHTTPFastcgi 创建Fastcgi
func (this *HTTPFastcgiService) CreateHTTPFastcgi(ctx context.Context, req *pb.CreateHTTPFastcgiRequest) (*pb.CreateHTTPFastcgiResponse, error) {
adminId, userId, err := this.ValidateAdminAndUser(ctx)
adminId, userId, err := this.ValidateAdminAndUser(ctx, true)
if err != nil {
return nil, err
}
@@ -32,7 +32,7 @@ func (this *HTTPFastcgiService) CreateHTTPFastcgi(ctx context.Context, req *pb.C
// UpdateHTTPFastcgi 修改Fastcgi
func (this *HTTPFastcgiService) UpdateHTTPFastcgi(ctx context.Context, req *pb.UpdateHTTPFastcgiRequest) (*pb.RPCSuccess, error) {
_, userId, err := this.ValidateAdminAndUser(ctx)
_, userId, err := this.ValidateAdminAndUser(ctx, true)
if err != nil {
return nil, err
}
@@ -53,7 +53,7 @@ func (this *HTTPFastcgiService) UpdateHTTPFastcgi(ctx context.Context, req *pb.U
// FindEnabledHTTPFastcgi 获取Fastcgi详情
func (this *HTTPFastcgiService) FindEnabledHTTPFastcgi(ctx context.Context, req *pb.FindEnabledHTTPFastcgiRequest) (*pb.FindEnabledHTTPFastcgiResponse, error) {
_, userId, err := this.ValidateAdminAndUser(ctx)
_, userId, err := this.ValidateAdminAndUser(ctx, true)
if err != nil {
return nil, err
}
@@ -87,7 +87,7 @@ func (this *HTTPFastcgiService) FindEnabledHTTPFastcgi(ctx context.Context, req
// FindEnabledHTTPFastcgiConfig 获取Fastcgi配置
func (this *HTTPFastcgiService) FindEnabledHTTPFastcgiConfig(ctx context.Context, req *pb.FindEnabledHTTPFastcgiConfigRequest) (*pb.FindEnabledHTTPFastcgiConfigResponse, error) {
_, userId, err := this.ValidateAdminAndUser(ctx)
_, userId, err := this.ValidateAdminAndUser(ctx, true)
if err != nil {
return nil, err
}