mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-12 23:00:25 +08:00
优化接口权限
This commit is contained in:
@@ -13,7 +13,7 @@ type FileService struct {
|
||||
|
||||
// FindEnabledFile 查找文件
|
||||
func (this *FileService) FindEnabledFile(ctx context.Context, req *pb.FindEnabledFileRequest) (*pb.FindEnabledFileResponse, error) {
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx)
|
||||
_, userId, err := this.ValidateAdminAndUser(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -49,7 +49,7 @@ func (this *FileService) FindEnabledFile(ctx context.Context, req *pb.FindEnable
|
||||
|
||||
// CreateFile 创建文件
|
||||
func (this *FileService) CreateFile(ctx context.Context, req *pb.CreateFileRequest) (*pb.CreateFileResponse, error) {
|
||||
adminId, userId, err := this.ValidateAdminAndUser(ctx)
|
||||
adminId, userId, err := this.ValidateAdminAndUser(ctx, false)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -65,7 +65,7 @@ func (this *FileService) CreateFile(ctx context.Context, req *pb.CreateFileReque
|
||||
|
||||
// UpdateFileFinished 将文件置为已完成
|
||||
func (this *FileService) UpdateFileFinished(ctx context.Context, req *pb.UpdateFileFinishedRequest) (*pb.RPCSuccess, 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