Skip to content

Commit

Permalink
Support CRUD share permissions
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Feb 9, 2022
1 parent d834616 commit 018ac1b
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 15 deletions.
5 changes: 2 additions & 3 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1004,10 +1004,9 @@ public function getInheritedShares(string $path): DataResponse {
}

/**
* Check wether a permissions set contains some permissions.
* @return bool
* Check whether a set of permissions contains the permissions to check.
*/
private function hasPermission(int $permissionsSet, int $permissionsToCheck) {
private function hasPermission(int $permissionsSet, int $permissionsToCheck): bool {
return ($permissionsSet & $permissionsToCheck) === $permissionsToCheck;
}

Expand Down
12 changes: 6 additions & 6 deletions apps/files_sharing/src/components/SharePermissionsEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export default {
data() {
return {
randomFormName: Math.random().toString(27).substr(2),
randomFormName: Math.random().toString(27).substring(2),
showCustomPermissionsForm: false,
Expand Down Expand Up @@ -170,7 +170,7 @@ export default {
},
/**
* Return wether the share's permission is a bundle.
* Return whether the share's permission is a bundle.
*
* @return {boolean}
*/
Expand All @@ -182,7 +182,7 @@ export default {
},
/**
* Return wether the share's permission is valid.
* Return whether the share's permission is valid.
*
* @return {boolean}
*/
Expand Down Expand Up @@ -218,7 +218,7 @@ export default {
methods: {
/**
* Return wether the share has the exact given permissions.
* Return whether the share has the exact given permissions.
*
* @param {number} permissions - the permissions to check.
*
Expand All @@ -230,7 +230,7 @@ export default {
},
/**
* Return wether the share has the given permissions.
* Return whether the share has the given permissions.
*
* @param {number} permissions - the permissions to check.
*
Expand All @@ -253,7 +253,7 @@ export default {
},
/**
* Return wether some given permissions can be toggled.
* Return whether some given permissions can be toggled.
*
* @param {number} permissionsToToggle - the permissions to toggle.
*
Expand Down
6 changes: 3 additions & 3 deletions apps/files_sharing/src/lib/SharePermissionsToolBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const BUNDLED_PERMISSIONS = {
}

/**
* Return wether a given permissions set contains some permissions.
* Return whether a given permissions set contains some permissions.
*
* @param {number} initialPermissionSet - the permissions set.
* @param {number} permissionsToCheck - the permissions to check.
Expand All @@ -48,7 +48,7 @@ export function hasPermissions(initialPermissionSet, permissionsToCheck) {
}

/**
* Return wether a given permissions set is valid.
* Return whether a given permissions set is valid.
*
* @param {number} permissionsSet - the permissions set.
*
Expand Down Expand Up @@ -111,7 +111,7 @@ export function togglePermissions(initialPermissionSet, permissionsToToggle) {
}

/**
* Return wether some given permissions can be toggled from a permission set.
* Return whether some given permissions can be toggled from a permission set.
*
* @param {number} permissionSet - the initial permissions set.
* @param {number} permissionsToToggle - the permissions to toggle.
Expand Down
4 changes: 2 additions & 2 deletions dist/files_sharing-files_sharing_tab.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/files_sharing-files_sharing_tab.js.map

Large diffs are not rendered by default.

0 comments on commit 018ac1b

Please sign in to comment.