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

Change ACL serialisation method #463

Merged
merged 3 commits into from Jul 26, 2018

Conversation

Projects
None yet
3 participants
@eduardoboucas
Copy link
Member

eduardoboucas commented Jul 25, 2018

Previously, ACL data for a list of resources would be stored as:

{
  'resource:1.0_one': {
    create: true,
    read: true,
    update: true
  },
  'resource:1.0_two': {
    delete: true,
    update: true
  }
}

This is a problem when using a MongoDB database, since resource:1.0_one is not a valid key (because of the dot). As a result, this PR changes the above structure to:

[
  {
    r: 'resource:one',
    a: {
      create: true,
      read: true,
      update: true
    }
  },
  {
    r: 'resource:two',
    a: {
      delete: true,
      update: true
    }
  }
]

This is then translated back to the object notation for output and for a series of internal manipulations. The user will never see the array notation.

@eduardoboucas eduardoboucas requested a review from jimlambie Jul 25, 2018

@coveralls

This comment has been minimized.

Copy link

coveralls commented Jul 25, 2018

Pull Request Test Coverage Report for Build 1421

  • 26 of 26 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.02%) to 88.962%

Totals Coverage Status
Change from base Build 1417: 0.02%
Covered Lines: 3280
Relevant Lines: 3586

💛 - Coveralls

@jimlambie jimlambie changed the base branch from develop to release-4.0.1 Jul 25, 2018

@eduardoboucas eduardoboucas changed the base branch from release-4.0.1 to release-4.0.2 Jul 26, 2018

@eduardoboucas eduardoboucas merged commit c341c1e into release-4.0.2 Jul 26, 2018

4 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage increased (+0.02%) to 88.962%
Details
security/snyk - package.json (DADI) No new issues
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment