Skip to content

Conversation

@SergioBertolinSG
Copy link
Contributor

Test for owncloud/QA#301
And a current failing case. cc @PVince81

@mention-bot
Copy link

@SergioBertolinSG, thanks for your PR! By analyzing the history of the files in this pull request, we identified @rullzer, @PVince81 and @MorrisJobke to be potential reviewers.

And group "new-group" exists
And user "user0" belongs to group "new-group"
And user "user1" belongs to group "new-group"
And Assure user "user0" is subadmin of group "new-group"
Copy link
Contributor

Choose a reason for hiding this comment

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

subadmin really needed ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps not, it comes from here #25542 (comment)

| shareType | 3 |
| publicUpload | false |
When Updating last share with
| publicUpload | true |
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks legitimate. At line 1002 the share is read-write so it's acceptable that the recipient can also make the link share read-write.

Did you mean to make the local share read-only ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, you're right. I'll change it.

@PVince81
Copy link
Contributor

Pfff, this API thing is a real mess. Some checks are done in the share manager, others are done only in the OCS controller...

@PVince81
Copy link
Contributor

Basically the createShare method in the OCS controller doesn't check if permissions can be increased, but a check is done in the sharemanager.
However for updateShare it is done in the OCS controller but not in the share manager.

@SergioBertolinSG can we also have integration tests for creating link shares as reshares for a read-write and read-only received share ?

@PVince81
Copy link
Contributor

Debugging in the updateShare case, apparently the share manager calls $share->getNode()->getPermissions() which returns 31. These are the permissiosn from the POV of the owner, not the recipient.

But weird thing that this check is correct when creating shares...

@PVince81
Copy link
Contributor

Ok, got it. The problem is as follows: the Node that was set to the Share object to be modified is different depending if create or update:

  • for createShare: the Node is set to "/user1/files/test", the received folder
  • for updateShare: since the owner is "user0", the node sets itself to "/user0/files/test". And because of this, the permissions returned for the share's node is different, the ones from the owner's POV not the recipient. However when creating shares, we always need the permissions from the POV of the recipient.

So need to look into whether we need to "fix" the node in the share manager, or adjust the node in the OCS controller code. It looks like the logic would let us discard the permissions validation logic from the OCS controller and only rely on the one in the manager, which would be ideal.

@PVince81
Copy link
Contributor

Looks like for the share manager we need to somehow try and get the node with the POV of the user who is specified in "getSharedBy()" instead of relying on the node that was specified in the share itself as it might be inaccurate.

@PVince81
Copy link
Contributor

Some POC here: fe38088

Would be good to add many more integration tests to make sure everything is covered (including reshare-creation perm denied)
Will also add unit tests for the share manager change.

@SergioBertolinSG
Copy link
Contributor Author

SergioBertolinSG commented Nov 22, 2016

@SergioBertolinSG can we also have integration tests for creating link shares as reshares for a read-write and read-only received share ?

You mean without permission to share?

@PVince81
Copy link
Contributor

You mean without permission to share?

I didn't mean that. But you're right that it needs to be added as well.

@PVince81
Copy link
Contributor

For now I'll focus on the quick fix. The clean but more risky fix will be done for 9.2 separately: #26684 (more risky because it will affect more cases that we need to make sure we cover as well)

@PVince81 PVince81 force-pushed the integration-tests-modifying-permissions branch from fe38088 to 2ba0f9a Compare November 22, 2016 12:38
| shareType | 3 |
| publicUpload | false |
When Updating last share with
| publicUpload | true |
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we also have the same tests with the "permissions" attribute ? @SergioBertolinSG

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure.

@SergioBertolinSG
Copy link
Contributor Author

@SergioBertolinSG can we also have integration tests for creating link shares as reshares for a read-write and read-only received share ?

With sharing permission, these cases are covered in
'Scenario: Adding public upload to a shared folder as recipient is allowed with permissions' and 'Scenario: Adding public upload to a read only shared folder as recipient is not allowed'
aren't they?

Without sharing permissions there is 'Scenario: User is not allowed to reshare file' and 'Scenario: User is not allowed to reshare file with more permissions'. They reshare like regular shares, Do we need different tests using public links shares?

@PVince81
Copy link
Contributor

Do we need different tests using public links shares?

Yes, that would be good as it's a slightly different code path.

@PVince81
Copy link
Contributor

Seems Jenkins env is broken, I resubmit the PR with your commits squashed here: #26691

@PVince81 PVince81 closed this Nov 22, 2016
@PVince81 PVince81 deleted the integration-tests-modifying-permissions branch November 22, 2016 17:32
@lock
Copy link

lock bot commented Aug 4, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants