Skip to content

Fix federated link sharing permissions - #20726

Merged
rullzer merged 1 commit into
masterfrom
fix/sharing-link-default-permissions
May 4, 2020
Merged

Fix federated link sharing permissions#20726
rullzer merged 1 commit into
masterfrom
fix/sharing-link-default-permissions

Conversation

@skjnldsv

@skjnldsvskjnldsv commented Apr 29, 2020

Copy link
Copy Markdown
Member

So, it of course means we don't store the SHARE permissions for link shares. We only add it on api GET.

It was mostly because of this

if ($permissions !== null) {
$newPermissions = (int) $permissions;
$newPermissions = $newPermissions & ~Constants::PERMISSION_SHARE;
}

i don't really know what we should do for this. So instead of changing 2 years old code that looks super speficic, I rathered make sure we keep it consistent. Maybe it's wrong, please suggest any better way 👋

In any case, this is a bit odd because when changint the link share to something like READ, we now see in the response that they have the SHARE permission, despite not really being asked for, but I guess it's fine as it behave like an enforced setting?

Reference: #19793 (comment)

It might fix#20692

@skjnldsvskjnldsv self-assigned this Apr 29, 2020
@skjnldsvskjnldsv added this to the Nextcloud 19 milestone Apr 29, 2020
@npmbuildbot-nextcloud
npmbuildbot-nextcloudBotforce-pushed the fix/sharing-link-default-permissions branch from 20b049e to 109f614CompareApril 29, 2020 14:54
@skjnldsv
skjnldsvforce-pushed the fix/sharing-link-default-permissions branch from 109f614 to d221e77CompareApril 29, 2020 14:58
@skjnldsv
skjnldsv marked this pull request as ready for review April 29, 2020 14:58
This was referenced Apr 30, 2020

@rullzerrullzer left a comment

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.

does the job!

@rullzer
rullzer requested review from gary-kim and kesselbMay 1, 2020 10:41
@rullzer

Copy link
Copy Markdown
Member

Needs a rebase and then time to get it in

@skjnldsv
skjnldsvforce-pushed the fix/sharing-link-default-permissions branch from d221e77 to fd7b0b1CompareMay 2, 2020 10:13
@skjnldsv

Copy link
Copy Markdown
MemberAuthor

/compile amend /

@npmbuildbot-nextcloud
npmbuildbot-nextcloudBotforce-pushed the fix/sharing-link-default-permissions branch from fd7b0b1 to 6322edeCompareMay 2, 2020 10:22
@MorrisJobke

Copy link
Copy Markdown
Member

Conflicts

@MorrisJobkeMorrisJobke added 2. developing Work in progress and removed 3. to review Waiting for reviews labels May 4, 2020
@skjnldsv
skjnldsvforce-pushed the fix/sharing-link-default-permissions branch from 6322ede to 5d0ffceCompareMay 4, 2020 11:37
@skjnldsvskjnldsv added 4. to release Ready to be released and/or waiting for tests to finish and removed 2. developing Work in progress labels May 4, 2020
@skjnldsv

Copy link
Copy Markdown
MemberAuthor

/compile amend /

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Signed-off-by: npmbuildbot[bot] <npmbuildbot[bot]@users.noreply.github.com>
@npmbuildbot-nextcloud
npmbuildbot-nextcloudBotforce-pushed the fix/sharing-link-default-permissions branch from 5d0ffce to ff20da6CompareMay 4, 2020 11:48

@MorrisJobkeMorrisJobke left a comment

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.

Code makes sense 👍

@skjnldsvskjnldsv added 2. developing Work in progress and removed 4. to release Ready to be released and/or waiting for tests to finish labels May 4, 2020
@skjnldsv

Copy link
Copy Markdown
MemberAuthor

Lots of test sfailures 😞

@rullzer
rullzer merged commit edb19cc into masterMay 4, 2020
@rullzer
rullzer deleted the fix/sharing-link-default-permissions branch May 4, 2020 19:04
@MorrisJobke

Copy link
Copy Markdown
Member

@skjnldsv@rullzer Why was this merged even if it had failures?

@rullzer

Copy link
Copy Markdown
Member

mmm Did I hit merge on the wrong PR... guess so...

}

if ($share->getShareType() === Share::SHARE_TYPE_USER) {
// TODO: It might make sense to have a dedicated setting to allow/deny converting link shares into federated ones

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.

I remember the discussion here but I guess I only now see the full impact. The permission needs to be persisted in the DB else the share conversion still doesn't happen. Because other part of the NC code don't use this they uyse the share object.

So either we do not care at all. ANd just check where we need to. Or we need to also make sure it is correct in the db.

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.

I guess this basically reverts what we tried to do in #19793

Let me prepare a fix

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Error updating the share" when "allow editing" at sharing

4 participants

@skjnldsv@rullzer@MorrisJobke@gary-kim