Steps to reproduce
- As user A, share a folder with user B using Read + Share only (no edit/create/delete).
- As user B, open the share dialog and reshare that folder (to a Team, or to another user).
- In permissions, note that Edit is offered and enabled (the dialog starts at full permissions).
- Leave Edit enabled and save.
Expected
User B can only reshare with the permissions they hold (read + share). Edit / Create / Delete should be disabled or hidden, since B can't grant them.
Actual
The share is rejected with Cannot increase permissions of <path>. B is offered a toggle they can't actually use and only learns that from a backend error.
Suggested fix
Clamp the default and selectable permissions to fileInfo.sharePermissions when resharing, so a read-only resharer can't pick edit/create/delete. Keep the backend guard as the safety net.
Steps to reproduce
Expected
User B can only reshare with the permissions they hold (read + share). Edit / Create / Delete should be disabled or hidden, since B can't grant them.
Actual
The share is rejected with
Cannot increase permissions of <path>. B is offered a toggle they can't actually use and only learns that from a backend error.Suggested fix
Clamp the default and selectable permissions to
fileInfo.sharePermissionswhen resharing, so a read-only resharer can't pick edit/create/delete. Keep the backend guard as the safety net.