@@ -105,8 +105,10 @@ final class NewSpaceShareViewModel: ObservableObject {
105105 canChangeInvite = participantSpaceView. permissions. canEditPermissions && participantSpaceView. permissions. canDeleteLink
106106
107107 updateUpgradeViewState ( )
108-
109- rows = participants. map { participant in
108+
109+ let filteredParticipants = participantSpaceView. permissions. canEditPermissions ? participants : participants. filter { $0. status == . active }
110+
111+ rows = filteredParticipants. map { participant in
110112 let isYou = workspaceInfo. profileObjectID == participant. identityProfileLink
111113 return SpaceShareParticipantViewModel (
112114 id: participant. id,
@@ -157,6 +159,7 @@ final class NewSpaceShareViewModel: ObservableObject {
157159 }
158160
159161 private func participantContextActions( _ participant: Participant ) -> [ SpaceShareParticipantViewModel . ContextAction ] {
162+ guard let participantSpaceView, participantSpaceView. permissions. canEditPermissions else { return [ ] }
160163 guard participant. permission != . owner else { return [ ] }
161164 switch participant. status {
162165 case . active:
@@ -199,7 +202,7 @@ final class NewSpaceShareViewModel: ObservableObject {
199202 }
200203 ) ] : [ ]
201204 case . removing:
202- return [
205+ return canApproveRequests ? [
203206 SpaceShareParticipantViewModel . ContextAction (
204207 title: Loc . SpaceShare. Action. approve,
205208 isSelected: false ,
@@ -210,7 +213,7 @@ final class NewSpaceShareViewModel: ObservableObject {
210213 try await self ? . workspaceService. leaveApprove ( spaceId: participant. spaceId, identity: participant. identity)
211214 self ? . toastBarData = ToastBarData ( Loc . SpaceShare. Approve. toast ( participant. title) )
212215 }
213- ) ]
216+ ) ] : [ ]
214217 case . removed, . declined, . canceled, . UNRECOGNIZED( _) :
215218 return [ ]
216219 }
0 commit comments