Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

feat(clapi): Add export / import acl option in clapi on master #5655

Merged
merged 15 commits into from
Oct 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions doc/en/api/clapi/objects/acl_menu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,29 +125,31 @@ If you want to grant in Read/Write, Read Only or revoke menus in an ACL Menu rul

Let's assume that you would like to grant full access to the [Monitoring] menu in your ACL Menu rule:::

[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantrw -v "ACL Menu test;Monitoring"
[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantrw -v "ACL Menu test;1;Monitoring"

Then, you would like to grant access to the [Home] > [Poller statistics] menu:::

[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantrw -v "ACL Menu test;Home;Poller statistics"
[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantrw -v "ACL Menu test;1;Home;Poller statistics"

Then, you would like to grant access in read only to the [Configuration] > [Hosts] menu:::

[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantro -v "ACL Menu test;Configuration;Hosts"
[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantro -v "ACL Menu test;1;Configuration;Hosts"

Then, you decide to revoke access from [Monitoring] > [Event Logs]:::

[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a revoke -v "ACL Menu test;Monitoring;Event Logs"
[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a revoke -v "ACL Menu test;1;Monitoring;Event Logs"


Arguments are composed of the following columns:

======= ============================
Order Column description
======= ============================
1 Name of ACL menu rule
1 Name of ACL menu rule

2 Grant/revoke children menus

2 Menu name to grant/revoke
3 Menu name to grant/revoke

n Possible sub menu name
n Possible sub menu name
======= ============================
16 changes: 9 additions & 7 deletions doc/fr/api/clapi/objects/acl_menu.rst
Original file line number Diff line number Diff line change
Expand Up @@ -124,29 +124,31 @@ If you want to grant in Read/Write, Read Only or revoke menus in an ACL Menu rul

Let's assume that you would like to grant full access to the [Monitoring] menu in your ACL Menu rule:::

[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantrw -v "ACL Menu test;Monitoring"
[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantrw -v "ACL Menu test;1;Monitoring"

Then, you would like to grant access to the [Home] > [Poller statistics] menu:::

[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantrw -v "ACL Menu test;Home;Poller statistics"
[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantrw -v "ACL Menu test;1;Home;Poller statistics"

Then, you would like to grant access in read only to the [Configuration] > [Hosts] menu:::

[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantro -v "ACL Menu test;Configuration;Hosts"
[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a grantro -v "ACL Menu test;1;Configuration;Hosts"

Then, you decide to revoke access from [Monitoring] > [Event Logs]:::

[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a revoke -v "ACL Menu test;Monitoring;Event Logs"
[root@centreon ~]# ./centreon -u admin -p centreon -o ACLMENU -a revoke -v "ACL Menu test;1;Monitoring;Event Logs"


Arguments are composed of the following columns:

======= ============================
Order Column description
======= ============================
1 Name of ACL menu rule
1 Name of ACL menu rule

2 Grant/revoke children menus

2 Menu name to grant/revoke
3 Menu name to grant/revoke

n Possible sub menu name
n Possible sub menu name
======= ============================
7 changes: 7 additions & 0 deletions lib/Centreon/Object/Relation/Acl/Group/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ class Centreon_Object_Relation_Acl_Group_Action extends Centreon_Object_Relation
protected $relationTable = "acl_group_actions_relations";
protected $firstKey = "acl_group_id";
protected $secondKey = "acl_action_id";

public function __construct()
{
parent::__construct();
$this->firstObject = new Centreon_Object_Acl_Group();
$this->secondObject = new Centreon_Object_Acl_Action();
}
}
7 changes: 7 additions & 0 deletions lib/Centreon/Object/Relation/Acl/Group/Contact/Contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ class Centreon_Object_Relation_Acl_Group_Contact extends Centreon_Object_Relatio
protected $relationTable = "acl_group_contacts_relations";
protected $firstKey = "acl_group_id";
protected $secondKey = "contact_contact_id";

public function __construct()
{
parent::__construct();
$this->firstObject = new Centreon_Object_Acl_Group();
$this->secondObject = new Centreon_Object_Contact();
}
}
7 changes: 7 additions & 0 deletions lib/Centreon/Object/Relation/Acl/Group/Contact/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ class Centreon_Object_Relation_Acl_Group_Contact_Group extends Centreon_Object_R
protected $relationTable = "acl_group_contactgroups_relations";
protected $firstKey = "acl_group_id";
protected $secondKey = "cg_cg_id";

public function __construct()
{
parent::__construct();
$this->firstObject = new Centreon_Object_Acl_Group();
$this->secondObject = new Centreon_Object_Contact_Group();
}
}
7 changes: 7 additions & 0 deletions lib/Centreon/Object/Relation/Acl/Group/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ class Centreon_Object_Relation_Acl_Group_Menu extends Centreon_Object_Relation
protected $relationTable = "acl_group_topology_relations";
protected $firstKey = "acl_group_id";
protected $secondKey = "acl_topology_id";

public function __construct()
{
parent::__construct();
$this->firstObject = new Centreon_Object_Acl_Group();
$this->secondObject = new Centreon_Object_Acl_Menu();
}
}
7 changes: 7 additions & 0 deletions lib/Centreon/Object/Relation/Acl/Group/Resource.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,11 @@ class Centreon_Object_Relation_Acl_Group_Resource extends Centreon_Object_Relati
protected $relationTable = "acl_res_group_relations";
protected $firstKey = "acl_group_id";
protected $secondKey = "acl_res_id";

public function __construct()
{
parent::__construct();
$this->firstObject = new Centreon_Object_Acl_Group();
$this->secondObject = new Centreon_Object_Acl_Resource();
}
}
Loading