Skip to content

fix(trashbin): restrict restore and delete on the frontend#8392

Merged
hamza221 merged 1 commit into
mainfrom
fix/restrict-trashbin
Jun 2, 2026
Merged

fix(trashbin): restrict restore and delete on the frontend#8392
hamza221 merged 1 commit into
mainfrom
fix/restrict-trashbin

Conversation

@hamza221
Copy link
Copy Markdown
Contributor

@hamza221 hamza221 commented May 23, 2026

In case of delegation and sharing (read-only), user might not have enough privilege to restore or permanently delete objects,
currently the frontend fails, this PR hides the buttons instead .

@codecov
Copy link
Copy Markdown

codecov Bot commented May 23, 2026

Codecov Report

❌ Patch coverage is 0% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/store/calendars.js 0.00% 15 Missing and 4 partials ⚠️

📢 Thoughts on this report? Let us know!

Comment thread src/store/calendars.js Outdated
@@ -194,6 +197,8 @@ export default {
url: vobject.uri,
deletedAt: vobject.dav._props['{http://nextcloud.com/ns}deleted-at'],
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I know this is not really part of the scope, but when you are adding the access methods can you also add them for any other missing ones

vobject.dav._props['{http://nextcloud.com/ns}deleted-at']

Comment thread src/store/calendars.js Outdated
const withoutTrail = calendar.url.replace(/\/$/, '')
const uri = withoutTrail.slice(withoutTrail.lastIndexOf('/') + 1)
calendarUriMap[uri] = calendar
calendarBySource.set(`${lastSegment(calendar.owner)}|${sourceUriOf(calendar)}`, calendar)
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@SebastianKrupinski is it safe to assume that url/ owner always follows this ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't know for sure but in a delegated scenario, the calendar owner is the original owner, in a shared scenario the owner is the original owner also. But in a shared scenario the uri is different than the original uri, not sure about delegated uri atm.

So I guess it depends on the intent, are you trying to match all the different calendar and object to the original owner or separate them.

@hamza221 hamza221 mentioned this pull request May 25, 2026
10 tasks
Copy link
Copy Markdown
Contributor

@GVodyanov GVodyanov left a comment

Choose a reason for hiding this comment

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

Tested and works

@hamza221 hamza221 changed the title fix(trashbin): restrict retore and delete on the frontend fix(trashbin): restrict restore and delete on the frontend May 26, 2026
@hamza221 hamza221 force-pushed the fix/restrict-trashbin branch from e84a628 to 71582df Compare May 27, 2026 12:05
Copy link
Copy Markdown
Contributor

@SebastianKrupinski SebastianKrupinski left a comment

Choose a reason for hiding this comment

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

Looks good

Signed-off-by: Hamza <hamzamahjoubi221@gmail.com>
@hamza221 hamza221 force-pushed the fix/restrict-trashbin branch from 71582df to 8d20663 Compare May 27, 2026 16:26
@hamza221 hamza221 enabled auto-merge May 28, 2026 11:21
@hamza221 hamza221 disabled auto-merge June 2, 2026 15:35
@hamza221
Copy link
Copy Markdown
Contributor Author

hamza221 commented Jun 2, 2026

Bypassing codecov

@hamza221 hamza221 merged commit 9f5fe08 into main Jun 2, 2026
59 of 83 checks passed
@hamza221 hamza221 deleted the fix/restrict-trashbin branch June 2, 2026 15:35
@SebastianKrupinski
Copy link
Copy Markdown
Contributor

/backport to stable6.4

@backportbot backportbot Bot added the backport-request A backport was requested for this pull request label Jun 2, 2026
@backportbot backportbot Bot removed the backport-request A backport was requested for this pull request label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants