import {
  AuthenticationJwtGuard,
  AuthorizationPermissionsGuard,
} from '@aurora/modules/authentication';
import { Permissions, AuthenticationDisabledAdapterGuard, AuthorizationDisabledAdapterGuard } from '@aurorajs.dev/core-back';
import { applyDecorators, UseGuards } from '@nestjs/common';

export function Auth(...permissions: string[]): MethodDecorator & ClassDecorator {
  return applyDecorators(
    Permissions(...permissions),
    UseGuards(AuthenticationDisabledAdapterGuard, AuthorizationDisabledAdapterGuard),
  );
}
