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

Rest api rt temporary acl fix #6188

Merged
merged 4 commits into from
Apr 9, 2018
Merged

Rest api rt temporary acl fix #6188

merged 4 commits into from
Apr 9, 2018

Conversation

leoncx
Copy link
Contributor

@leoncx leoncx commented Apr 5, 2018

Separate Rest Api configuration and Rest Api realtime access.

Add the choise to access on each API on the user configuration page.

leoncx added 3 commits April 4, 2018 14:35
An user can have a role to access to configuration API or realtime API.
* Add the parameter reach_api_rt on contact and contact template
Use the database flag instead the is_admin
Copy link
Contributor

@kduret kduret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think default admin user on fresh install does not have access to realtime api

* @param string $action The action name
* @param array $user The current user
* @param boolean $isInternal If the api is call in internal
* @return boolean If the has access to the action
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotation : "boolean If the ? has..."

* @param string $action The action name
* @param array $user The current user
* @param boolean $isInternal If the api is call in internal
* @return boolean If the has access to the action
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotation : "boolean If the ? has..."

* @param string $action The action name
* @param array $user The current user
* @param boolean $isInternal If the api is call in internal
* @return boolean If the has access to the action
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotation : "boolean If the ? has..."

* @param string $action The action name
* @param array $user The current user
* @param boolean $isInternal If the api is call in internal
* @return boolean If the has access to the action
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotation : "boolean If the ? has..."

* @param string $action The action name
* @param array $user The current user
* @param boolean $isInternal If the api is call in internal
* @return boolean If the has access to the action
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Annotation : "boolean If the ? has..."

@@ -531,6 +532,8 @@ function updateContact($contact_id = null, $from_MC = false)
isset($ret["contact_oreon"]["contact_oreon"]) && $ret["contact_oreon"]["contact_oreon"] != null ? $rq .= "'" . $ret["contact_oreon"]["contact_oreon"] . "', " : $rq .= "NULL, ";
$rq .= "reach_api = ";
isset($ret["reach_api"]["reach_api"]) && $ret["reach_api"]["reach_api"] != null ? $rq .= "'" . $ret["reach_api"]["reach_api"] . "', " : $rq .= "NULL, ";
$rq .= "reach_api_rt = ";
isset($ret["reach_api_rt"]["reach_api_rt"]) && $ret["reach_api_rt"]["reach_api_rt"] != null ? $rq .= "'" . $ret["reach_api_rt"]["reach_api_rt"] . "', " : $rq .= "NULL, ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding Style : lenght >120chars

@@ -439,6 +439,7 @@ function insertContact($ret = array())
isset($ret["contact_oreon"]["contact_oreon"]) && $ret["contact_oreon"]["contact_oreon"] != null ? $rq .= "'" . $ret["contact_oreon"]["contact_oreon"] . "', " : $rq .= " '1', ";
}
isset($ret["reach_api"]["reach_api"]) && $ret["reach_api"]["reach_api"] != null ? $rq .= $ret["reach_api"]["reach_api"] . ", " : $rq .= " 0, ";
isset($ret["reach_api_rt"]["reach_api_rt"]) && $ret["reach_api_rt"]["reach_api_rt"] != null ? $rq .= $ret["reach_api_rt"]["reach_api_rt"] . ", " : $rq .= " 0, ";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding Style : lenght >120chars

@@ -395,7 +395,7 @@ function insertContact($ret = array())
"`contact_id` , `timeperiod_tp_id` , `timeperiod_tp_id2` , `contact_name` , " .
"`contact_alias` , `contact_autologin_key` , `contact_passwd` , `contact_lang` , `contact_template_id`, " .
"`contact_host_notification_options` , `contact_service_notification_options` , " .
"`contact_email` , `contact_pager` , `contact_comment` , `contact_oreon`, `reach_api`, `contact_register`, `contact_enable_notifications` , " .
"`contact_email` , `contact_pager` , `contact_comment` , `contact_oreon`, `reach_api`, `reach_api_rt`, `contact_register`, `contact_enable_notifications` , " .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding Style : lenght >120chars

@@ -118,14 +118,15 @@
{if $displayAdminFlag == 1}
<tr class="list_two"><td class="FormRowField"><img class="helpTooltip" name="admin"> {$form.contact_admin.label}</td><td class="FormRowValue">{$form.contact_admin.html}</td></tr>
<tr class="list_one"><td class="FormRowField"><img class="helpTooltip" name="reach_api"> {$form.reach_api.label}</td><td class="FormRowValue">{$form.reach_api.html}</td></tr>
<tr class="list_two"><td class="FormRowField"><img class="helpTooltip" name="reach_api_rt"> {$form.reach_api_rt.label}</td><td class="FormRowValue">{$form.reach_api_rt.html}</td></tr>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding Style : lenght > 120chars

{/if}
<tr class="list_lvl_1">
<td class="ListColLvl1_name" colspan="2">
<h4>{$form.header.acl}</h4>
</td>
</tr>
{if $o == "mc"}
<tr class="list_two"><td class="FormRowField"><img class="helpTooltip" name="mc_update"> {$form.mc_mod_acl.label}</td><td class="FormRowValue">{$form.mc_mod_acl.html}</td></tr>
<tr class="list_one"><td class="FormRowField"><img class="helpTooltip" name="mc_update"> {$form.mc_mod_acl.label}</td><td class="FormRowValue">{$form.mc_mod_acl.html}</td></tr>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Coding Style : lenght > 120chars

* Fix bad comment
* Split line to be less of 120 characters
@leoncx leoncx merged commit 9bbdd69 into 2.8.x Apr 9, 2018
@leoncx leoncx deleted the rest-api-rt-temporary-acl-fix branch April 9, 2018 13:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants