Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing space member list for group memberships #11395

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Missing space members for group memberships

We've fixed a bug where group members of a space could not see other space members on regular resources within the space.

https://github.com/owncloud/web/issues/11384
https://github.com/owncloud/web/pull/11395
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,6 @@ export default defineComponent({
const toggleMemberListCollapsed = () => {
memberListCollapsed.value = !unref(memberListCollapsed)
}
const currentUserIsMemberOfSpace = computed(() => {
const userId = store.getters.user?.id
if (!userId) {
return false
}
return store.getters['runtime/spaces/spaceMembers'].some(
(member) => member.collaborator?.name === userId
)
})

const ancestorMetaData: Ref<AncestorMetaData> = computed(
() => store.getters['runtime/ancestorMetaData/ancestorMetaData']
Expand All @@ -175,7 +166,6 @@ export default defineComponent({
toggleShareListCollapsed,
memberListCollapsed,
toggleMemberListCollapsed,
currentUserIsMemberOfSpace,
hasProjectSpaces: useCapabilityProjectSpacesEnabled(),
hasShareJail: useCapabilityShareJailEnabled(),
hasResharing: useCapabilityFilesSharingResharing(),
Expand Down Expand Up @@ -291,7 +281,7 @@ export default defineComponent({
return (
this.space?.driveType === 'project' &&
this.resource.type !== 'space' &&
this.currentUserIsMemberOfSpace
this.space?.isMember(this.user)
)
},

Expand Down Expand Up @@ -524,7 +514,7 @@ export default defineComponent({
// fixMe: head-breaking logic
isShareModifiable(collaborator) {
const isPersonalSpaceShare = !isProjectSpaceResource(this.space)
const isPersonalMember = this.currentUserIsMemberOfSpace
const isPersonalMember = this.space?.isMember(this.user)
const isIndirectPersonalCollaborator = collaborator.indirect
const isProjectSpaceShare = !isPersonalSpaceShare
const isManager = this.space?.isManager(this.user)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ describe('FileShares', () => {
describe('current space', () => {
it('loads space members if a space is given and the current user is member', () => {
const user = { id: '1' }
const space = mock<SpaceResource>({ driveType: 'project' })
const space = mock<SpaceResource>({ driveType: 'project', isMember: () => true })
const spaceMembers = [{ collaborator: { name: user.id } }, { collaborator: { name: 2 } }]
const collaborator = getCollaborator()
collaborator.collaborator = { ...collaborator.collaborator, name: user.id }
Expand Down