Skip to content

[cbox-commit-1] Expose capability to deny access in OCS API#3064

Open
labkode wants to merge 1 commit into
cs3org:masterfrom
cernbox:commit-1
Open

[cbox-commit-1] Expose capability to deny access in OCS API#3064
labkode wants to merge 1 commit into
cs3org:masterfrom
cernbox:commit-1

Conversation

@labkode
Copy link
Copy Markdown
Member

@labkode labkode commented Jul 11, 2022

No description provided.

@labkode labkode requested review from a team, glpatcern and ishank011 as code owners July 11, 2022 11:58
PermissionAll Permissions = (1 << (iota - 1)) - 1
PermissionAll = PermissionMax - PermissionNone
// PermissionMin is to be used within value range checks
PermissionMin = PermissionRead
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should not change the bitmask. We should use roles instead. The permissions bitmask is considered deprecated and will not work in spaces.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

That's fine, this PR is not expected to work with spaces, only for the master branch.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ok but the testsuite will never pass on this. The permissions bitmask ends with 31 everything above that will be considered as "invalid permission"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah we found that earlier, I think we will add those tests in the expected failures files for time being as this will (are) fixed in the edge branch.

Comment thread pkg/share/share.go
// This filter type is used to filter out "denial shares". These are currently implemented by having the permission "0".
// I.e. if the permission is 0 we don't want to show it.
return int(conversions.RoleFromResourcePermissions(share.Permissions.Permissions).OCSPermissions()) != 0
return share.Permissions.Permissions.DenyGrant
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You should use permissionsNone here because you want to filter out the denials not the DenyGrant

Copy link
Copy Markdown
Member

@micbar micbar left a comment

Choose a reason for hiding this comment

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

See comments.

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.

2 participants