refactor(core): Rename RequireGlobalScope to GlobalScope (no-changelog) (#8760)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-02-28 14:40:02 +01:00
committed by GitHub
parent 246bfb9ad4
commit 2811f77798
15 changed files with 70 additions and 77 deletions

View File

@@ -6,7 +6,7 @@ import {
Licensed,
Patch,
Post,
RequireGlobalScope,
GlobalScope,
RestController,
} from '@/decorators';
import { VariablesService } from './variables.service.ee';
@@ -21,14 +21,14 @@ export class VariablesController {
constructor(private readonly variablesService: VariablesService) {}
@Get('/')
@RequireGlobalScope('variable:list')
@GlobalScope('variable:list')
async getVariables() {
return await this.variablesService.getAllCached();
}
@Post('/')
@Licensed('feat:variables')
@RequireGlobalScope('variable:create')
@GlobalScope('variable:create')
async createVariable(req: VariablesRequest.Create) {
const variable = req.body;
delete variable.id;
@@ -45,7 +45,7 @@ export class VariablesController {
}
@Get('/:id')
@RequireGlobalScope('variable:read')
@GlobalScope('variable:read')
async getVariable(req: VariablesRequest.Get) {
const id = req.params.id;
const variable = await this.variablesService.getCached(id);
@@ -57,7 +57,7 @@ export class VariablesController {
@Patch('/:id')
@Licensed('feat:variables')
@RequireGlobalScope('variable:update')
@GlobalScope('variable:update')
async updateVariable(req: VariablesRequest.Update) {
const id = req.params.id;
const variable = req.body;
@@ -75,7 +75,7 @@ export class VariablesController {
}
@Delete('/:id(\\w+)')
@RequireGlobalScope('variable:delete')
@GlobalScope('variable:delete')
async deleteVariable(req: VariablesRequest.Delete) {
const id = req.params.id;
await this.variablesService.delete(id);