Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: support for overriding field, view, and record permission s… #567

Merged
merged 1 commit into from
Apr 12, 2024

Conversation

boris-w
Copy link
Contributor

@boris-w boris-w commented Apr 12, 2024

…ervices

In order to override the service in the AppModule when it is used, you need to register the service you want to override as global.
Example:

const app = await NestFactory.create(
    AppModule.register({
      ...appModules,
      imports: [
        GlobalModule.register({
          providers: [{ provide: FieldPermissionService, useClass: OverrideFieldPermissionService }],
        }),
        ...appModules.imports,
      ],
    })
  );

@boris-w boris-w requested a review from tea-artist April 12, 2024 07:32
@coveralls
Copy link
Collaborator

Pull Request Test Coverage Report for Build 8658538481

Details

  • 30 of 43 (69.77%) changed or added relevant lines in 6 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+62.3%) to 82.674%

Changes Missing Coverage Covered Lines Changed/Added Lines %
apps/nestjs-backend/src/app.module.ts 10 15 66.67%
apps/nestjs-backend/src/global/global.module.ts 14 22 63.64%
Totals Coverage Status
Change from base Build 8656634571: 62.3%
Covered Lines: 27208
Relevant Lines: 32910

💛 - Coveralls

@boris-w boris-w merged commit 6360707 into develop Apr 12, 2024
6 checks passed
@boris-w boris-w deleted the refactor/override-import-module-service branch April 12, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants