Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Fix Root Group management issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Nov 26, 2015
1 parent ced1fdf commit de81b04
Show file tree
Hide file tree
Showing 13 changed files with 29 additions and 5 deletions.
Expand Up @@ -2405,12 +2405,13 @@ public function listRoles($root, $child, $hashValue = null, $returnNodes = false
<column messageId="ajxp_conf.62" attributeName="rights_summary" sortType="String"/>
</columns>');
if(!AuthService::usersEnabled()) return array();
$currentUserIsGroupAdmin = (AuthService::getLoggedUser() != null && AuthService::getLoggedUser()->getGroupPath() != "/");
$roles = AuthService::getRolesList(array(), !$this->listSpecialRoles);
ksort($roles);
if(!$this->listSpecialRoles && !$this->getName() == "ajxp_admin"){
$mess = ConfService::getMessages();
if(!$this->listSpecialRoles && $this->getName() != "ajxp_admin" && !$currentUserIsGroupAdmin){
$rootGroupRole = AuthService::getRole("AJXP_GRP_/", true);
if($rootGroupRole->getLabel() == "AJXP_GRP_/"){
$mess = ConfService::getMessages();
$rootGroupRole->setLabel($mess["ajxp_conf.151"]);
AuthService::updateRole($rootGroupRole);
}
Expand All @@ -2431,10 +2432,14 @@ public function listRoles($root, $child, $hashValue = null, $returnNodes = false
}
$rightsString = implode(", ", $r);
$nodeKey = "/data/roles/".$roleObject->getId();
$appliesToDefault = implode(",", $roleObject->listAutoApplies());
if($roleObject->getId() == "AJXP_GRP_/"){
$appliesToDefault = $mess["ajxp_conf.153"];
}
$meta = array(
"icon" => "user-acl.png",
"rights_summary" => $rightsString,
"is_default" => implode(",", $roleObject->listAutoApplies()), //($roleObject->autoAppliesTo("standard") ? $mess[440]:$mess[441]),
"is_default" => $appliesToDefault, //($roleObject->autoAppliesTo("standard") ? $mess[440]:$mess[441]),
"ajxp_mime" => "role",
"role_id" => $roleObject->getId(),
"text" => $roleObject->getLabel()
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/access.ajxp_conf/i18n/de.php
Expand Up @@ -175,4 +175,5 @@
"150" => "Eine Arbeitsumgebung auswählen",
"151" => "Root Group",
"152" => "Root Group Role",
"153" => "Applies to the whole hierarchy of users",
);
1 change: 1 addition & 0 deletions core/src/plugins/access.ajxp_conf/i18n/en.php
Expand Up @@ -174,4 +174,5 @@
"150" => "Select a repository",
"151" => "Root Group",
"152" => "Root Group Role",
"153" => "Applies to the whole hierarchy of users",
);
2 changes: 2 additions & 0 deletions core/src/plugins/access.ajxp_conf/i18n/es.php
Expand Up @@ -174,4 +174,6 @@
"150" => "Select a repository",
"151" => "Root Group",
"152" => "Root Group Role",
"153" => "Applies to the whole hierarchy of users",

);
1 change: 1 addition & 0 deletions core/src/plugins/access.ajxp_conf/i18n/fi.php
Expand Up @@ -177,5 +177,6 @@
"150" => "Select a repository",
"151" => "Root Group",
"152" => "Root Group Role",
"153" => "Applies to the whole hierarchy of users",
/* END SENTENCE */
);
2 changes: 2 additions & 0 deletions core/src/plugins/access.ajxp_conf/i18n/fr.php
Expand Up @@ -174,4 +174,6 @@
"150" => "Select a repository",
"151" => "Groupe Racine",
"152" => "Role du groupe racine",
"153" => "S'applique à toute la hiérarchie des utilisateurs",

);
3 changes: 2 additions & 1 deletion core/src/plugins/access.ajxp_conf/i18n/hu.php
Expand Up @@ -176,5 +176,6 @@
"150" => "Select a repository",
"151" => "Root Group",
"152" => "Root Group Role",
/* END SENTENCE */
"153" => "Applies to the whole hierarchy of users",
/* END SENTENCE */
);
2 changes: 2 additions & 0 deletions core/src/plugins/access.ajxp_conf/i18n/it.php
Expand Up @@ -174,4 +174,6 @@
"150" => "Seleziona un repository",
"151" => "Root Group",
"152" => "Root Group Role",
"153" => "Applies to the whole hierarchy of users",

);
2 changes: 2 additions & 0 deletions core/src/plugins/access.ajxp_conf/i18n/nl.php
Expand Up @@ -174,5 +174,7 @@
"150" => "Select a repository",
"151" => "Root Group",
"152" => "Root Group Role",
"153" => "Applies to the whole hierarchy of users",

);

2 changes: 2 additions & 0 deletions core/src/plugins/access.ajxp_conf/i18n/pt.php
Expand Up @@ -174,4 +174,6 @@
"150" => "Select a repository",
"151" => "Root Group",
"152" => "Root Group Role",
"153" => "Applies to the whole hierarchy of users",

);
1 change: 1 addition & 0 deletions core/src/plugins/access.ajxp_conf/i18n/ru.php
Expand Up @@ -174,4 +174,5 @@
"150" => "Select a repository",
"151" => "Root Group",
"152" => "Root Group Role",
"153" => "Applies to the whole hierarchy of users",
);
1 change: 1 addition & 0 deletions core/src/plugins/access.ajxp_conf/i18n/si.php
Expand Up @@ -175,4 +175,5 @@
"150" => "Select a repository",
"151" => "Root Group",
"152" => "Root Group Role",
"153" => "Applies to the whole hierarchy of users",
);
5 changes: 4 additions & 1 deletion core/src/plugins/editor.ajxp_role/class.RoleEditor.js
Expand Up @@ -146,7 +146,7 @@ Class.create("RoleEditor", AbstractEditor, {
this.roleData.USER.PROFILE = this.element.down("#account_infos").down("select[name='profile']").getValue();
this.roleData.USER.ROLES = this.element.down("#account_infos").down("select[name='roles']").getValue();
fullPostData["USER"] = this.roleData.USER;
}else if(this.roleData.GROUP){
}else if(this.roleData.GROUP && this.element.down("#account_infos").down("input[name='groupLabel']")){
this.roleData.GROUP.LABEL = this.element.down("#account_infos").down("input[name='groupLabel']").getValue();
fullPostData["GROUP_LABEL"] = this.roleData.GROUP.LABEL;
}
Expand Down Expand Up @@ -417,6 +417,9 @@ Class.create("RoleEditor", AbstractEditor, {
this.roleWrite.APPLIES = appliesSelect.getValue();
}.bind(this) );
new Chosen(appliesSelect, {placeholder_text_multiple:MessageHash["ajxp_role_editor.43"]});
if(getBaseName(node.getPath()) == "AJXP_GRP_"){
this.element.down("#pane-infos").down("#account_infos").down('div.SF_element.form-element-applies').setStyle({display:'none'});
}

}else if(scope == "group"){
// MAIN INFO
Expand Down

0 comments on commit de81b04

Please sign in to comment.