Commit Graph

41 Commits

Author SHA1 Message Date
Ralf Haferkamp
3dc9c0cb9a Switch to opencloud-eu fork of libre-graph-api-go 2025-05-15 14:11:35 +02:00
Alex
38169e60ae fix: show special roles at the end of the list (#806) 2025-05-10 11:23:01 +02:00
André Duffeck
e8d35e1280 Use the opencloud reva from now on 2025-01-21 11:16:38 +01:00
Jörn Friedrich Dreyer
b07b5a1149 use plain pkg module
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-13 16:42:19 +01:00
Jörn Friedrich Dreyer
8e028f17e9 change module name
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2025-01-13 09:58:18 +01:00
Michael Barz
bac2256c5f fix: fix deny access to prevent a regression 2024-11-25 11:32:31 +01:00
Michael Barz
8b8aad6591 fix: improve some wordings and cli table 2024-09-13 14:24:45 +02:00
Florian Schade
3a4c0f33ea fix: ocm share update 2024-09-11 15:34:08 +02:00
Roman Perekhod
d3e8eb34df [full-ci] Added a new roles viewer/editor with ListGrants 2024-09-02 11:33:18 +02:00
Roman Perekhod
6319d986eb [full-ci] Added a new role space editor without versions 2024-08-29 14:20:35 +02:00
Florian Schade
4b09399ab9 chore: merge master 2024-08-27 18:22:13 +02:00
Florian Schade
4f2678351d fix: cherry pick unified-role federation changes 2024-08-21 14:10:46 +02:00
Florian Schade
e348ac290e enhancement: only use allowed roles for the graph service 2024-08-21 14:08:39 +02:00
Florian Schade
196c988b8c enhancement: add unified roles filters 2024-08-21 14:08:38 +02:00
Florian Schade
4638280d21 enhancement: add allowed role validation to the go-playground validator 2024-08-21 14:08:29 +02:00
Florian Schade
56537e94fc enhancement: do not enable all roles by default.
from now on, not all unified roles are enabled by default, instead the available roles are hand-picked in the default setup.

For advanced use-cases, the administrator is capable to enable the desired set of available roles.

Picking roles is not easy since the uid is NOT humanly readable, therefore a cli is contained which lists the available, disabled and enabled roles.
2024-08-21 14:08:27 +02:00
Jörn Friedrich Dreyer
99c6b6648e no need to introduce dedicated roles
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-08-13 16:10:19 +02:00
Jörn Friedrich Dreyer
8da4e265bd Update services/graph/pkg/unifiedrole/unifiedrole.go
Co-authored-by: kobergj <jkoberg@owncloud.com>
2024-08-13 11:53:10 +02:00
Jörn Friedrich Dreyer
966b4e1422 allow querying federated sharing roles
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
2024-08-12 11:29:39 +02:00
Roman Perekhod
90bd1fc403 the translator added to handlers 2024-08-06 14:25:30 +02:00
Ralf Haferkamp
26b4927ed8 Address go-vet reported issues
mainly "copylocks: return copies lock value" related things
2024-07-11 16:59:25 +02:00
Michael Barz
8cd2277f6d tests: fix unit tests 2024-07-04 17:34:10 +02:00
Michael Barz
7860cb8a6f fix: polish secure view 2024-07-04 17:14:40 +02:00
Ralf Haferkamp
72a6ea3cfa fix(graph): Fix tests after Uploader Role changes 2024-05-21 16:48:17 +02:00
Jannik Stehle
1aeb30193a feat: add secure view share role
Adds a new share role "Secure View". This role is applicable for files, folders and spaces and only allows viewing them (and their content).
2024-04-29 09:42:31 +02:00
Ralf Haferkamp
9ca9b78b2b fix(sharing-ng): Adapt role conditions to match resource types
This switches our hardcode unfied role conditions to better reflect what
we're actually using them before. The new conditions also allow to differentiate
between roles elgitible for files, folders or drive roots.
Which means that the `/permissions` endpoint is now able to populate the
`roles.allowedValues` field with the correct roles for type of the resource
it is called for.

Fixes: #8331
2024-04-12 10:09:13 +02:00
Ralf Haferkamp
fe6986ec79 cleanup(graph): remove some resharing leftovers 2024-04-12 10:09:13 +02:00
jkoberg
b174b005e7 remove resharing
Signed-off-by: jkoberg <jkoberg@owncloud.com>
2024-04-05 10:19:14 +02:00
Florian Schade
25b40cf7a3 fix: make use of ResourcePermissions getters 2024-03-27 16:02:44 +01:00
Jannik Stehle
2968570a84 refactor: adjust sharing ng role names and descriptions
Adjusts display names and descriptions of sharing NG roles to align with the previously agreed upon terms.
2024-03-27 09:59:55 +01:00
Ralf Haferkamp
dcdbfd81d4 chore: rework cs3ReceivedSharesToDriveItems to make linter happy 2024-03-18 11:53:57 +01:00
Ralf Haferkamp
0f33c7ae96 enhancement(graph): cs3PermissionsToLibreGraph can also return v1beta1 format
This reworks the cs3PermissionsToLibreGraph() so that it is able to return
the libreGraph.Permissions in the legacy and the new v1beta1 format. The main
differences between both are that v1beta1 returns the identities in the
'grantedToV2' property and the 'roles' are returned as IDs instead of the
legacy role names.
2024-03-18 11:53:57 +01:00
Ralf Haferkamp
8fdfa1aee7 enhancement(graph): Remove unneded Coowner Role
This role was renamed to "Manager" a while ago.
2024-03-18 11:53:57 +01:00
Ralf Haferkamp
d9fc4af575 graph/sharing: Add check for role conditions
Use the condition from the unifiedrole to check if the requested role
is actually applicable to the selected resource.

Fixes: #8131
2024-01-24 17:03:00 +01:00
Ralf Haferkamp
f38f940d22 graph/sharing: Fix role conditions for Space specific sharing roles
Co-Owner and Manager are space specific roles. They need the UnifiedRoleConditionOwner.
2024-01-24 17:03:00 +01:00
Ralf Haferkamp
269ce605dd graph sharing: Implement UpdatePermissions
This is an initial implementation of PATCH support on drives/{driveid}/items/{itemid}/permissions/{id}.
It focusses on updating user shares for now. It's possible to update the
expirationDate, roles and/or libregraphResourceActions.
Updating the permissions of a space root or a public link share is currently
not implemeted.
2023-12-08 10:55:12 +01:00
Florian Schade
34f3ab66c1 feature: add beta drive listing endpoints to the graph api (#7861)
* feature: add beta drive listing endpoints to the graph api and hydrate them to contain the new grantedtoV2 property and use unified roles instead of the cs3 roles

* enhancement: make use of owner conditions for drive listing

* enhancement: provide GetDrivesV1Beta1 and GetAllDrivesV1Beta1 graph endpoint tests
2023-12-06 10:01:38 +01:00
Florian Schade
ad06a192d8 enhancement: add graph beta listPermissions endpoint (#7753)
* enhancement: add graph beta listPermissions endpoint

besides the new api endpoint it includes several utilities to simplify the graph api development.

* resolve drive and item id from the request path
* generic pointer and value utilities
* space root detection

* update GetDriveAndItemIDParam signature to return a error

* move errorcode package

* enhancement: add generic error code handling

* fix: rebase
2023-11-28 17:06:04 +01:00
Florian Schade
40d356c56b enhancement: make use of unifiedrole from the graph invitation endpoint, applying multiple roles works and result in a merged cs3 permission set (#7751) 2023-11-23 14:18:03 +01:00
Ralf Haferkamp
9303cdece7 graph: Set roles/actions in sharedByMe response (#7703)
* unifiedrole: Add CS3ResourcePermissionsToLibregraphActions

Add function to convert CS3ResourcePermsissions to libregraph actions

* unifiedrole: Fix strings for the UnifiedRoleConditionSelf

The "Self/Owner/Grantee" string are not part the the constraint value

* graph: Move getRoleDefinitionList to unifiedrole module

rename it to GetBuiltinRoleDefinitionList and make it public

* graph: turn libregraph resource actions into string constants

* graph/sharedbyme: Set the correct roles (or actions) on permissions

Try to map CS3 resource permissions on a share to one of the default libregraph
UnifiedRoleDefinitions. If a match if found return the roleid in 'permissions.roles'
attribute of the response. If no match if found convert the
ResourcePermissions in to `libre.graph.permissions.actions` and return
those in the response.
2023-11-17 15:41:24 +01:00
Ralf Haferkamp
50f63bf436 bump reva to latest edge (#7727)
* bump reva to latest edge

To get https://github.com/cs3org/reva/pull/4336

* graph: Import unified role related code from reva

The UnifiedRole related types are pretty specific to the graph service.
Maintaining them as part of reva makes things more complex that required.

* chore: add failing cases to the expected failures

---------

Co-authored-by: Florian Schade <f.schade@icloud.com>
2023-11-17 09:18:45 +01:00