Skip to content

feat(scopes): add scopes retrieval service#695

Merged
larcin merged 11 commits intoepic/application-wide-scopesfrom
poc/application-wide-scopes
Apr 29, 2021
Merged

feat(scopes): add scopes retrieval service#695
larcin merged 11 commits intoepic/application-wide-scopesfrom
poc/application-wide-scopes

Conversation

@larcin
Copy link
Copy Markdown
Contributor

@larcin larcin commented Apr 26, 2021

Usage:

import { scopeManager } from 'forest-express';

// With user being the one from the request and `environments` being the collectionName
const scopes = await scopeManager.getScopeForUser(user, 'environments');

Format (only collections having scopes are retrieved):

{
  aggregator: 'and',
  conditions: [
    {
      field: 'type',
      operator: 'equal',
      value: 'production',
    },
  ],
}

Pull Request checklist:

  • Write an explicit title for the Pull Request, following Conventional Commits specification
  • Test manually the implemented changes
  • Review my own code (indentation, syntax, style, simplicity, readability)
  • Wonder if you can improve the existing code

@romain-gilliotte romain-gilliotte self-requested a review April 27, 2021 12:03
Copy link
Copy Markdown
Contributor

@romain-gilliotte romain-gilliotte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments in files.

  • tests are missing :)

Comment thread src/services/exposed/scope-service.js Outdated
Comment thread src/services/exposed/scope-service.js Outdated
Comment thread src/services/exposed/scope-service.js Outdated
Comment thread src/services/scope-manager.js Outdated
Comment thread src/services/scope-manager.js Outdated
Comment thread src/services/scope-manager.js Outdated
Comment thread src/services/scope-manager.js Outdated
@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit 9ab6350 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 92.5% (60% is the threshold).

This pull request will bring the total coverage in the repository to 55.3%.

View more on Code Climate.

@larcin larcin changed the base branch from master to epic/application-wide-scopes April 29, 2021 10:04
@larcin larcin merged commit 476b94d into epic/application-wide-scopes Apr 29, 2021
@larcin larcin deleted the poc/application-wide-scopes branch April 29, 2021 10:21
@larcin larcin restored the poc/application-wide-scopes branch April 29, 2021 10:23
@larcin larcin deleted the poc/application-wide-scopes branch April 29, 2021 10:28
ShohanRahman pushed a commit that referenced this pull request Jan 25, 2022
## [7.6.3](ForestAdmin/forest-express-sequelize@v7.6.2...v7.6.3) (2021-04-22)

### Bug Fixes

* **search:** enable to search for a big integer in an ID field ([#695](ForestAdmin/forest-express-sequelize#695)) ([9f8132c](ForestAdmin/forest-express-sequelize@9f8132c))
ShohanRahman pushed a commit that referenced this pull request Jan 25, 2022
# [8.0.0-beta.3](ForestAdmin/forest-express-sequelize@v8.0.0-beta.2...v8.0.0-beta.3) (2021-05-26)

### Bug Fixes

* **smart-actions-change-hook:** record is no longer altered and is sent correctly ([#728](ForestAdmin/forest-express-sequelize#728)) ([2ac7af8](ForestAdmin/forest-express-sequelize@2ac7af8))
* distribution charts using groupby on a relationship throws 403 Forbidden ([#725](ForestAdmin/forest-express-sequelize#725)) ([30e6744](ForestAdmin/forest-express-sequelize@30e6744))
* regression when fetching has-many and not selecting any fields on a hasone/belongsto relation ([#720](ForestAdmin/forest-express-sequelize#720)) ([74ed623](ForestAdmin/forest-express-sequelize@74ed623))
* **schema:** do not remove primary key fields from the schema when tables have foreign keys that are primary keys ([8844fb5](ForestAdmin/forest-express-sequelize@8844fb5))
* **search:** enable to search for a big integer in an ID field ([#695](ForestAdmin/forest-express-sequelize#695)) ([9f8132c](ForestAdmin/forest-express-sequelize@9f8132c))
* **search:** searching for a big int value should not break if there is a regular integer field ([#694](ForestAdmin/forest-express-sequelize#694)) ([af076ad](ForestAdmin/forest-express-sequelize@af076ad))
* **security:** patch ssri dependency vulnerability ([#690](ForestAdmin/forest-express-sequelize#690)) ([6b0770d](ForestAdmin/forest-express-sequelize@6b0770d))

### Features

* **browsing-context:** allow `Forest-Context-Url` header to give the current browser url of users ([#665](ForestAdmin/forest-express-sequelize#665)) ([c46fd66](ForestAdmin/forest-express-sequelize@c46fd66))
* **filters:** add support for the \`model.field IN array\` filter condition ([#719](ForestAdmin/forest-express-sequelize#719)) ([5f58457](ForestAdmin/forest-express-sequelize@5f58457))
* add support for belongsTo and hasOne filters on related data ([#715](ForestAdmin/forest-express-sequelize#715)) ([2bc769e](ForestAdmin/forest-express-sequelize@2bc769e))
* support yarn 2 plug n play install mode ([#698](ForestAdmin/forest-express-sequelize#698)) ([64b5734](ForestAdmin/forest-express-sequelize@64b5734))

### BREAKING CHANGES

* **browsing-context:** users willing to use this header needs either to clean the allowed headers or to add this specific header in the CORS configuration
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.

2 participants