Skip to content

Commit

Permalink
fix: share create permission naming
Browse files Browse the repository at this point in the history
  • Loading branch information
JammingBen committed Nov 13, 2023
1 parent d51b377 commit ef4766b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/web-runtime/src/services/auth/abilities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export const getAbilities = (
{ action: 'read-all', subject: 'Role' },
{ action: 'update-all', subject: 'Role' }
],
'Share.Create.all': [{ action: 'create-all', subject: 'Share' }],
'Shares.Write.all': [
{ action: 'create-all', subject: 'Share' },
{ action: 'update-all', subject: 'Share' }
],
'Settings.ReadWrite.all': [
{ action: 'read-all', subject: 'Setting' },
{ action: 'update-all', subject: 'Setting' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ describe('getAbilities', () => {
expect(abilities).toEqual(expectedActions.map((action) => ({ action, subject: 'PublicLink' })))
})
it('gets correct abilities for subject "Share"', function () {
const abilities = getAbilities(['Share.Create.all'])
const expectedActions = ['create-all']
const abilities = getAbilities(['Shares.Write.all'])
const expectedActions = ['create-all', 'update-all']
expect(abilities).toEqual(expectedActions.map((action) => ({ action, subject: 'Share' })))
})
it('gets correct abilities for subject "Setting"', function () {
Expand Down

0 comments on commit ef4766b

Please sign in to comment.