-
Notifications
You must be signed in to change notification settings - Fork 159
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add permissions only if they exist for the role
- Loading branch information
Showing
16 changed files
with
230 additions
and
189 deletions.
There are no files selected for viewing
5 changes: 3 additions & 2 deletions
5
apps/files/src/components/Collaborators/AdditionalPermissions.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import moment from 'moment' | ||
import { bitmaskToRole } from '../helpers/collaborators' | ||
import { bitmaskToRole, permissionsBitmask } from '../helpers/collaborators' | ||
|
||
function _buildFile (file) { | ||
let ext = '' | ||
|
@@ -223,10 +223,10 @@ function _buildShare (s, file) { | |
share.displayName = s.share_with_displayname | ||
// TODO: Refactor to work with roles / prepare for roles API | ||
share.customPermissions = { | ||
update: s.permissions === '3' || s.permissions === '15' || s.permissions === '19' || s.permissions === '31', | ||
create: s.permissions === '5' || s.permissions === '15' || s.permissions === '21' || s.permissions === '31', | ||
delete: s.permissions === '9' || s.permissions === '15' || s.permissions === '25' || s.permissions === '31', | ||
share: s.permissions === '17' || s.permissions === '19' || s.permissions === '21' || s.permissions === '25' || s.permissions === '31' | ||
update: s.permissions & permissionsBitmask.update, | ||
create: s.permissions & permissionsBitmask.create, | ||
delete: s.permissions & permissionsBitmask.delete, | ||
share: s.permissions & permissionsBitmask.share | ||
} | ||
// share.email = '[email protected]' // hm, where do we get the mail from? share_with_additional_info:Object? | ||
break | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.