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

@@ -1,5 +1,5 @@
import pick from 'lodash/pick';
import { Authorized, Get, Post, Put, RestController, RequireGlobalScope } from '@/decorators';
import { Authorized, Get, Post, Put, RestController, GlobalScope } from '@/decorators';
import { InternalHooks } from '@/InternalHooks';
import { BadRequestError } from '@/errors/response-errors/bad-request.error';
@@ -17,13 +17,13 @@ export class LdapController {
) {}
@Get('/config')
@RequireGlobalScope('ldap:manage')
@GlobalScope('ldap:manage')
async getConfig() {
return await this.ldapService.loadConfig();
}
@Post('/test-connection')
@RequireGlobalScope('ldap:manage')
@GlobalScope('ldap:manage')
async testConnection() {
try {
await this.ldapService.testConnection();
@@ -33,7 +33,7 @@ export class LdapController {
}
@Put('/config')
@RequireGlobalScope('ldap:manage')
@GlobalScope('ldap:manage')
async updateConfig(req: LdapConfiguration.Update) {
try {
await this.ldapService.updateConfig(req.body);
@@ -52,14 +52,14 @@ export class LdapController {
}
@Get('/sync')
@RequireGlobalScope('ldap:sync')
@GlobalScope('ldap:sync')
async getLdapSync(req: LdapConfiguration.GetSync) {
const { page = '0', perPage = '20' } = req.query;
return await getLdapSynchronizations(parseInt(page, 10), parseInt(perPage, 10));
}
@Post('/sync')
@RequireGlobalScope('ldap:sync')
@GlobalScope('ldap:sync')
async syncLdap(req: LdapConfiguration.Sync) {
try {
await this.ldapService.runSync(req.body.type);