Support User groups in permissions listing#3430
Merged
ildyria merged 5 commits intouser-groups/permissionsfrom Jul 4, 2025
Merged
Support User groups in permissions listing#3430ildyria merged 5 commits intouser-groups/permissionsfrom
ildyria merged 5 commits intouser-groups/permissionsfrom
Conversation
Codecov ReportAttention: Patch coverage is
🚀 New features to boost your workflow:
|
f5dc9d0 to
3756aa0
Compare
465b434 to
2982aa2
Compare
3756aa0 to
6dde592
Compare
2982aa2 to
9cbbc7d
Compare
sancsin
requested changes
Jul 1, 2025
| // Set up the permission in subSlbum | ||
| $response = $this->actingAs($this->userMayUpload1)->postJson('Sharing', [ | ||
| 'user_ids' => [$this->userLocked->id], | ||
| 'group_ids' => [], |
Contributor
There was a problem hiding this comment.
If we are adding group_ids, should the assertEquals count calls be for 2 rather than 1? For example in line 199?
Member
Author
6dde592 to
2bbce04
Compare
9cbbc7d to
8cbd16d
Compare
sancsin
approved these changes
Jul 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces support for sharing albums with user groups in addition to individual users. The changes span multiple files to extend the existing sharing functionality, update the database model, and enhance validation and testing. Below is a summary of the most important changes:
Sharing Functionality Enhancements:
applyUpdateandapplyOverwritemethods inapp/Actions/Sharing/Propagate.phpto handle permissions for user groups alongside individual users. ([[1]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-099be4abba0aef41c0c3e3f139f6df0d8b52fcf573d6bc2fe8b120f4be446720L52-R52),[[2]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-099be4abba0aef41c0c3e3f139f6df0d8b52fcf573d6bc2fe8b120f4be446720R62),[[3]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-099be4abba0aef41c0c3e3f139f6df0d8b52fcf573d6bc2fe8b120f4be446720L125-R126),[[4]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-099be4abba0aef41c0c3e3f139f6df0d8b52fcf573d6bc2fe8b120f4be446720R135))Share::domethod inapp/Actions/Sharing/Share.phpto accept bothuser_idanduser_group_idparameters, and added logic to load the associated user group. ([[1]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-ea159f4821c75cf6a4d3b3271e6273686592607be806df7d3cbfb0719f18dbe2R20-R34),[[2]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-ea159f4821c75cf6a4d3b3271e6273686592607be806df7d3cbfb0719f18dbe2R43))Database Model Updates:
user_group_idsupport to theAccessPermissionmodel, including new fillable attributes and type casting. ([[1]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-1dd7e2eab43d6518186bdf310214c9587a2942a7c98054107001c05054e7422aR76),[[2]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-1dd7e2eab43d6518186bdf310214c9587a2942a7c98054107001c05054e7422aR90))Usermodel for consistent permission checks. ([app/Models/User.phpR123-R130](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-37a2d7d879a7de3f7d73b2975cd22be9f41ec10c334a0dda9ad1e869332e4ecbR123-R130))API and Validation Enhancements:
HasUserGroupIdsinterface and trait to manage user group IDs in requests. ([[1]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-05b81c40be218dbe45d50a24dd501994bbec1247a72c366620554a1b2eafde89R1-R17),[[2]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-90b1d5bd6c3b34b6b303932b9761844cea879eb038795dbcb8e532f5b20be7f2R1-R25))AddSharingRequestto validateuser_group_idsand ensure at least one user or group is specified. ([[1]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-088c4204a668f60ad82325c3f0b14d9d963cf16c242f7acbbb9c938f7e55024eR19-R26),[[2]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-088c4204a668f60ad82325c3f0b14d9d963cf16c242f7acbbb9c938f7e55024eR37),[[3]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-088c4204a668f60ad82325c3f0b14d9d963cf16c242f7acbbb9c938f7e55024eL53-R59),[[4]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-088c4204a668f60ad82325c3f0b14d9d963cf16c242f7acbbb9c938f7e55024eR75-R81))Controller and Query Updates:
SharingControllermethods to support user groups in sharing logic, includingcreate,list, andlistAll. ([[1]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-600f9aa425dff07d96b096d9f9dc193ebd32ebfd8b6cacd23dd944f2c53a83dfL49-R77),[[2]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-600f9aa425dff07d96b096d9f9dc193ebd32ebfd8b6cacd23dd944f2c53a83dfL95-R117),[[3]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-600f9aa425dff07d96b096d9f9dc193ebd32ebfd8b6cacd23dd944f2c53a83dfL111-R138),[[4]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-600f9aa425dff07d96b096d9f9dc193ebd32ebfd8b6cacd23dd944f2c53a83dfL137-R164))Test Coverage:
tests/Feature_v2/Album/SharingTest.phpto cover user group sharing scenarios. ([[1]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-a352400531c5477c8773e977ade7e2893623e8766740ca40c918b59f1963a0a7R91),[[2]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-a352400531c5477c8773e977ade7e2893623e8766740ca40c918b59f1963a0a7L144-R146),[[3]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-a352400531c5477c8773e977ade7e2893623e8766740ca40c918b59f1963a0a7L159-R160),[[4]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-a352400531c5477c8773e977ade7e2893623e8766740ca40c918b59f1963a0a7L173-R177),[[5]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-a352400531c5477c8773e977ade7e2893623e8766740ca40c918b59f1963a0a7R190),[[6]](https://github.com/LycheeOrg/Lychee/pull/3430/files#diff-a352400531c5477c8773e977ade7e2893623e8766740ca40c918b59f1963a0a7R203))