Commit e8a369f0 authored by Alexandre Delanoë's avatar Alexandre Delanoë

Merge remote-tracking branch 'origin/adinapoli/issue-426' into dev

parents afd11132 f46a1ba7
......@@ -73,7 +73,8 @@ update loggedInUserId (Move sourceId targetId) = do
-> -- both are not read-only, normal move
move_db_update sourceId targetId
(False, True)
-> (:[]) <$> publish_node (SourceId sourceId) (TargetId targetId) NPP_publish_no_edits_allowed
-> do void $ publish_node (SourceId sourceId) (TargetId targetId) NPP_publish_no_edits_allowed
move_db_update sourceId targetId
(True, False)
-> -- the source is read only. If we are the owner we allow unpublishing.
-- FIXME(adn) is this check enough?
......@@ -82,7 +83,7 @@ update loggedInUserId (Move sourceId targetId) = do
True -> do
userPublicFolderNode <- getUserRootPublicNode loggedInUserId
unpublishNode (SourceId $ sourceId) (TargetId $ _node_id userPublicFolderNode)
pure [ _NodeId $ sourceId]
move_db_update sourceId targetId
False -> nodeError (NodeIsReadOnly targetId "logged user is not allowed to move/unpublish a read-only node")
(True, True)
-> -- this case is not allowed.
......
......@@ -76,7 +76,7 @@ instance HasDBid NodeNodeCategory where
NNC_publish <$> lookupDBid x
instance DefaultFromField SqlInt4 (Maybe NodeNodeCategory) where
defaultFromField = lookupDBid <$> fromPGSFromField
defaultFromField = (lookupDBid =<<) <$> fromPGSFromField
type NodeNode = NodeNodePoly NodeId NodeId (Maybe Double) (Maybe NodeNodeCategory)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment