@@ -648,7 +648,7 @@ public function switchAction(ServerRequestInterface &$requestInterface, Response
648
648
$ users = array (); $ groups = array ();
649
649
$ this ->getRightsManager ()->createUsersFromParameters ($ httpVars , $ users , $ groups );
650
650
651
- $ result = $ this ->createSharedRepository ($ httpVars , $ isUpdate , $ users , $ groups );
651
+ $ result = $ this ->createSharedRepository ($ httpVars , $ isUpdate , $ users , $ groups, $ ajxpNode );
652
652
653
653
if (is_object ($ result ) && $ result instanceof Repository) {
654
654
@@ -1573,7 +1573,7 @@ public function createSharedMinisite($httpVars, &$update)
1573
1573
$ users = array (); $ groups = array ();
1574
1574
$ users [$ hiddenUserEntry ["ID " ]] = $ hiddenUserEntry ;
1575
1575
1576
- $ newRepo = $ this ->createSharedRepository ($ httpVars , $ repoUpdate , $ users , $ groups );
1576
+ $ newRepo = $ this ->createSharedRepository ($ httpVars , $ repoUpdate , $ users , $ groups, $ userSelection -> getUniqueNode () );
1577
1577
1578
1578
$ shareObject ->setParentRepositoryId ($ this ->repository ->getId ());
1579
1579
$ shareObject ->attachToRepository ($ newRepo ->getId ());
@@ -1619,10 +1619,11 @@ public function createSharedMinisite($httpVars, &$update)
1619
1619
* @param bool $update
1620
1620
* @param array $users
1621
1621
* @param array $groups
1622
+ * @param AJXP_Node $originalNode
1622
1623
* @return Repository
1623
1624
* @throws \Exception
1624
1625
*/
1625
- public function createSharedRepository ($ httpVars , &$ update , $ users =array (), $ groups =array ())
1626
+ public function createSharedRepository ($ httpVars , &$ update , $ users =array (), $ groups =array (), $ originalNode = null )
1626
1627
{
1627
1628
// ERRORS
1628
1629
// 100 : missing args
@@ -1642,7 +1643,7 @@ public function createSharedRepository($httpVars, &$update, $users=array(), $gro
1642
1643
$ newRepo = $ this ->createOrLoadSharedRepository ($ httpVars , $ update );
1643
1644
1644
1645
$ selection = UserSelection::fromContext ($ this ->currentContext , $ httpVars );
1645
- $ this ->getRightsManager ()->assignSharedRepositoryPermissions ($ currentRepo , $ newRepo , $ update , $ users , $ groups , $ selection );
1646
+ $ this ->getRightsManager ()->assignSharedRepositoryPermissions ($ currentRepo , $ newRepo , $ update , $ users , $ groups , $ selection, $ originalNode );
1646
1647
1647
1648
// HANDLE WATCHES ON CHILDREN AND PARENT
1648
1649
foreach ($ users as $ userName => $ userEntry ){
@@ -1773,7 +1774,7 @@ public function shareNode(ContextInterface $ctx, $ajxpNode, $httpVars, &$update)
1773
1774
return null ;
1774
1775
}
1775
1776
1776
- $ newRepo = $ this ->createSharedRepository ($ httpVars , $ update , $ users , $ groups );
1777
+ $ newRepo = $ this ->createSharedRepository ($ httpVars , $ update , $ users , $ groups, $ ajxpNode );
1777
1778
1778
1779
foreach ($ shareObjects as $ shareObject ){
1779
1780
0 commit comments