@@ -800,6 +800,12 @@ public function switchAction($action, $httpVars, $fileVars)
800
800
$ roleData ["ACTIONS " ] = $ originalRole ->listActionsStates ();
801
801
}
802
802
803
+ if (isSet ($ roleData ["MASKS " ])){
804
+ foreach ($ roleData ["MASKS " ] as $ repoId => $ serialMask ){
805
+ $ roleData ["MASKS " ][$ repoId ] = new AJXP_PermissionMask ($ serialMask );
806
+ }
807
+ }
808
+
803
809
try {
804
810
$ originalRole ->bunchUpdate ($ roleData );
805
811
if (isSet ($ userObject )) {
@@ -1530,10 +1536,14 @@ public function switchAction($action, $httpVars, $fileVars)
1530
1536
$ shares = ConfService::getConfStorageImpl ()->simpleStoreList ("share " , null , "" , "serial " , '' , $ repId );
1531
1537
print ('<users total=" ' .$ users .'"/> ' );
1532
1538
print ('<shares total=" ' .count ($ shares ).'"/> ' );
1539
+ $ rootGroup = AuthService::getRole ("AJXP_GRP_/ " );
1540
+ if ($ rootGroup ->hasMask ($ repId )){
1541
+ print ("<mask><![CDATA[ " .json_encode ($ rootGroup ->getMask ($ repId ))."]]></mask> " );
1542
+ }
1533
1543
print "</additional_info> " ;
1534
1544
}
1535
1545
AJXP_XMLWriter::close ("admin_data " );
1536
- return ;
1546
+
1537
1547
break ;
1538
1548
1539
1549
case "edit_repository_label " :
@@ -1623,7 +1633,14 @@ public function switchAction($action, $httpVars, $fileVars)
1623
1633
return ;
1624
1634
}
1625
1635
}
1626
-
1636
+ // TODO : WHAT TO DO FOR SUB ADMINS ?
1637
+ if (isSet ($ httpVars ["permission_mask " ]) && !empty ($ httpVars ["permission_mask " ])){
1638
+ $ mask = json_decode ($ httpVars ["permission_mask " ], true );
1639
+ $ perm = new AJXP_PermissionMask ($ mask );
1640
+ $ rootGroup = AuthService::getRole ("AJXP_GRP_/ " );
1641
+ $ rootGroup ->setMask ($ repId , $ perm );
1642
+ AuthService::updateRole ($ rootGroup );
1643
+ }
1627
1644
ConfService::replaceRepository ($ repId , $ repo );
1628
1645
}
1629
1646
AJXP_XMLWriter::header ();
0 commit comments