Skip to content
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

Implement the spaces permission concept #6531

Merged
merged 8 commits into from
Mar 8, 2022
Merged

Implement the spaces permission concept #6531

merged 8 commits into from
Mar 8, 2022

Conversation

JammingBen
Copy link
Collaborator

@JammingBen JammingBen commented Mar 4, 2022

Description

We've implemented the spaces permission concept and improved the code structure for further permission changes.

Note that this PR does not yet include the permission check for the "Create New Space"-button. The permission for this is bound to the current user role, which needs some more in-depth work.

Related Issue

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

@JammingBen JammingBen self-assigned this Mar 4, 2022
@delete-merged-branch delete-merged-branch bot deleted the branch master March 7, 2022 11:03
@JammingBen JammingBen changed the base branch from spaces-collaborators to master March 7, 2022 11:21
@JammingBen JammingBen marked this pull request as ready for review March 8, 2022 09:01
@ownclouders
Copy link
Contributor

Results for oC10SharingExternal https://drone.owncloud.com/owncloud/web/23380/41/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oC10SharingFolderAdvPermsGrp https://drone.owncloud.com/owncloud/web/23380/39/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oC10SharingPublic1 https://drone.owncloud.com/owncloud/web/23380/36/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oC10SharingIntGroups https://drone.owncloud.com/owncloud/web/23383/27/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oC10SharingExternal https://drone.owncloud.com/owncloud/web/23383/41/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oC10SharingIntUsers1 https://drone.owncloud.com/owncloud/web/23383/29/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

@ownclouders
Copy link
Contributor

Results for oC10Upload https://drone.owncloud.com/owncloud/web/23383/38/1
💥 The acceptance tests pipeline failed. The build has been cancelled.

const graphClient = clientService.graphAuthenticated(instance, token)

let graphUser
if (context.rootState.user.version.edition === 'reva') {
Copy link
Member

Choose a reason for hiding this comment

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

That's a no-no. We don't want to differentiate backends. Either you can determine if the graph api is available (e.g. graphClient could have an available() getter which makes a ping (basically any request) via graph API, if that fails we remember in a variable that the graphClient is not available. Or you find some other attribute how to check if the graph API is available. E.g. introduce a capability in ocis.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ahh okay, I though this is legit as we have several isOcis-checks floating around. I'll discuss with the backend team what's most suitable here. A capability sounds nice.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As discussed in chat: We can use capabilities.spaces.enabled for now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

But I like the idea with the available() getter. Let me introduce that one at least.

Copy link
Member

Choose a reason for hiding this comment

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

The existing isOcis checks are deprecated and will be removed soonish. :-)

available() getter which wraps the capabilities check is superb 👍 then it's easy to switch over to proper graph permissions later on.

Copy link
Collaborator Author

@JammingBen JammingBen Mar 8, 2022

Choose a reason for hiding this comment

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

However, I'd need to inject the capabilities into the graphClient (hence editing all places where we fetch it). There is no way around it, right @kulmann ?

In conrete: clientService.graphAuthenticated(instance, token) -> clientService.graphAuthenticated(instance, token, capabilities)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've created #6551 to keep track on this. I think this PR is fine without for now.

Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

see comment

Copy link
Contributor

@AlexAndBear AlexAndBear left a comment

Choose a reason for hiding this comment

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

LGTM

@ownclouders
Copy link
Contributor

Results for oCISTrashbinUploadMoveJourney https://drone.owncloud.com/owncloud/web/23387/69/1
The following scenarios passed on retry:

  • webUITrashbinRestore/trashbinRestore.feature:279

@sonarcloud
Copy link

sonarcloud bot commented Mar 8, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 4 Code Smells

67.0% 67.0% Coverage
0.0% 0.0% Duplication

Copy link
Member

@kulmann kulmann left a comment

Choose a reason for hiding this comment

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

💪

@kulmann kulmann merged commit 51d04ba into master Mar 8, 2022
@delete-merged-branch delete-merged-branch bot deleted the spaces-permissions branch March 8, 2022 14:42
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.

4 participants