-
Notifications
You must be signed in to change notification settings - Fork 196
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
[tests-only][full-ci] added test to enable disable Secure Viewer permissions role for federated shares #10823
Conversation
85b7a21
to
222314c
Compare
|
For federated user, with API request the resources can be shared with permissions role |
222314c
to
9355c3f
Compare
62be978
to
1bce918
Compare
Making this PR back to review and added failing scenarios to expected to failure file. |
1bce918
to
5699738
Compare
tests/acceptance/features/apiOcm/enableDisablePermissionsRole.feature
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about allowed permission
5699738
to
2e0132f
Compare
This is the part of issue to check for the additional roles. Also, the test coverage for issues #10824 and #10822. So only the added scenarios will fit in this PR. |
34cab98
to
138eb5c
Compare
tests/acceptance/features/apiOcm/enableDisablePermissionsRole.feature
Outdated
Show resolved
Hide resolved
tests/acceptance/features/apiOcm/enableDisablePermissionsRole.feature
Outdated
Show resolved
Hide resolved
138eb5c
to
265b7b0
Compare
LGTM 👍 |
If you want to check disabling of default roles then please only check this scenario: Given share with Editor role
When disable Editor role
Then check the share permissions (Should be viewer or something lower permission) |
Will do that in next PR. 👍 |
265b7b0
to
59f2e3b
Compare
ed4fdf9
to
3beb419
Compare
* @return void | ||
*/ | ||
public function userShouldBeAbleToDownloadArchiveOfFederatedSharedFolder(string $user, string $resource): void { | ||
$queryString = $this->getArchiverQueryString($user, $resource, 'remoteItemIds'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i had seen use of $this->archiverContext->getArchiverUrl
in tests/acceptance/bootstrap/SpacesContext.php
.
So, confused about the perfect place to add this step definition
@saw-jan @nirajacharya2 what do you think about where should we add a related step- definition if that step is part of space context also.
* @When /^public downloads the folder "([^"]*)" from the last created public link using the public files API$/
* @When user :user tries to download the space :spaceName owned by user :owner using the WebDAV API
* @When /^user "([^"]*)" (?:downloads|tries to download) the space "([^"]*)" using the WebDAV API$/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fine.
/** | ||
* @Then user :user should be able to download federated shared file :resource | ||
* | ||
* @param string $user | ||
* @param string $resource | ||
* | ||
* @return void | ||
*/ | ||
public function userShouldBeAbleToDownloadFederatedSharedFile(string $user, string $resource): void { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just modify the existing step for internal sharing? Better modifying step rather than repetition of code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not that much of a duplication. If we have a single method that handles everything, it would be messy and difficult to manage. So, we need to always maintain between DRY and readability/maintainability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't think readability gets compromised if we just merge two step because only different is "$baseUrl/$davPath/$remoteItemId",
this value and as you said this function is small so this will not be complicated logic . Another point is file size, as you can see number of line is crossing 4k.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current download related step uses makeDavRequest
function, and the dav path is set inside that function. To update this path $baseUrl/$davPath/$remoteItemId
we need to specify in makeDavRequest
function that this is a federated shared file. This makes the function more complex.
That's also the reason I have used HttpRequestHtlper::get()
directly in this step. Its just to make things less complex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about splitting context file. Dedicated context file for federation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can move these steps to OcmContext.php
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ocmcontext is a great place. 👍
4810439
to
13cb44c
Compare
13cb44c
to
316bd72
Compare
|
[tests-only][full-ci] added test to enable disable Secure Viewer permissions role for federated shares
Description
This PR adds tests to enable and disable the share permissions role Secure VIewer for federated shares.
Related Issue
Test Coverage for #10824 and #10822
Types of changes
Checklist: