diff --git a/src/Vervis/Client.hs b/src/Vervis/Client.hs index 41e8518..2cc86ff 100644 --- a/src/Vervis/Client.hs +++ b/src/Vervis/Client.hs @@ -1273,12 +1273,12 @@ remove -> FedURI -> FedURI -> ExceptT Text Handler (Maybe HTML, [Aud URIMode], AP.Remove URIMode) -remove personID uRecipient uResourceCollabs = do +remove personID uRecipient uCollection = do theater <- asksSite appTheater env <- asksSite appEnv - let activity = AP.Remove uRecipient uResourceCollabs + let activity = AP.Remove uRecipient uCollection (resource, recipient) <- runActE $ parseRemove (Left $ LocalActorPerson personID) activity @@ -1291,9 +1291,7 @@ remove personID uRecipient uResourceCollabs = do manager <- asksSite appHttpManager coll <- ExceptT $ liftIO $ first T.pack <$> AP.fetchAPID manager AP.collectionId h luColl lu <- fromMaybeE (AP.collectionContext (coll :: AP.Collection FedURI URIMode)) "Remote topic collabs has no 'context'" - AP.ResourceWithCollections _ mluCollabs _ mluMembers <- ExceptT $ liftIO $ first (T.pack . show) <$> AP.fetchRWC manager h lu - unless (mluCollabs == Just luColl || mluMembers == Just luColl) $ - throwE "Remove origin isn't a collabs list" + AP.ResourceWithCollections _ _mluCollabs _ _mluMembers <- ExceptT $ liftIO $ first (T.pack . show) <$> AP.fetchRWC manager h lu return $ ObjURI h lu ) resource diff --git a/src/Vervis/Handler/Client.hs b/src/Vervis/Handler/Client.hs index 5fe9b92..0b98260 100644 --- a/src/Vervis/Handler/Client.hs +++ b/src/Vervis/Handler/Client.hs @@ -1578,8 +1578,8 @@ postPublishAcceptR = do redirect HomeR removeForm = renderDivs $ (,,) - <$> areq fedUriField "(URI) Whom to remove" Nothing - <*> areq fedUriField "(URI) From which resource collaborators collection" Nothing + <$> areq fedUriField "(URI) Whom to remove" Nothing + <*> areq fedUriField "(URI) From which collection" Nothing <*> areq capField "(URI) Grant activity to use for authorization" Nothing getPublishRemoveR :: Handler Html @@ -1587,7 +1587,7 @@ getPublishRemoveR = do ((_, widget), enctype) <- runFormPost removeForm defaultLayout [whamlet| -

Remove someone from a resource +

Remove an actor from a collaborators/components/children/parents collection
^{widget} @@ -1598,14 +1598,14 @@ postPublishRemoveR = do federation <- getsYesod $ appFederation . appSettings unless federation badMethod - (uRecipient, uResourceCollabs, (uCap, cap)) <- + (uRecipient, uCollection, (uCap, cap)) <- runFormPostRedirect PublishRemoveR removeForm (ep@(Entity pid _), a) <- getSender senderHash <- encodeKeyHashid pid result <- runExceptT $ do - (maybeSummary, audience, rmv) <- remove pid uRecipient uResourceCollabs + (maybeSummary, audience, rmv) <- remove pid uRecipient uCollection (localRecips, remoteRecips, fwdHosts, action) <- makeServerInput (Just uCap) maybeSummary audience (AP.RemoveActivity rmv) handleViaActor pid (Just cap) localRecips remoteRecips fwdHosts action diff --git a/templates/personal-overview.hamlet b/templates/personal-overview.hamlet index 1d1427c..2a753fb 100644 --- a/templates/personal-overview.hamlet +++ b/templates/personal-overview.hamlet @@ -62,7 +62,8 @@ $# Comment on a ticket or merge request Invite someone to a resource
  • - Remove someone from a resource + Remove a collaborator/component/project/team from a + component/project/team/child/parent
  • Add a component/child/parent to a project/team