Audited the permissions names. Permissions names are to be non plural.
This commit is contained in:
@@ -36,16 +36,16 @@
|
||||
$apps[$x]['menu'][0]['groups'][] = 'superadmin';
|
||||
|
||||
//permission details
|
||||
$apps[$x]['permissions'][0]['name'] = 'services_view';
|
||||
$apps[$x]['permissions'][0]['name'] = 'service_view';
|
||||
$apps[$x]['permissions'][0]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][1]['name'] = 'services_add';
|
||||
$apps[$x]['permissions'][1]['name'] = 'service_add';
|
||||
$apps[$x]['permissions'][1]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][2]['name'] = 'services_edit';
|
||||
$apps[$x]['permissions'][2]['name'] = 'service_edit';
|
||||
$apps[$x]['permissions'][2]['groups'][] = 'superadmin';
|
||||
|
||||
$apps[$x]['permissions'][3]['name'] = 'services_delete';
|
||||
$apps[$x]['permissions'][3]['name'] = 'service_delete';
|
||||
$apps[$x]['permissions'][3]['groups'][] = 'superadmin';
|
||||
|
||||
//schema details
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('services_delete')) {
|
||||
if (permission_exists('service_delete')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('services_add') || permission_exists('services_edit')) {
|
||||
if (permission_exists('service_add') || permission_exists('service_edit')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
@@ -90,7 +90,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
|
||||
//add or update the database
|
||||
if ($_POST["persistformvar"] != "true") {
|
||||
if ($action == "add" && permission_exists('services_add')) {
|
||||
if ($action == "add" && permission_exists('service_add')) {
|
||||
$service_uuid = uuid();
|
||||
$sql = "insert into v_services ";
|
||||
$sql .= "(";
|
||||
@@ -126,7 +126,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
||||
return;
|
||||
} //if ($action == "add")
|
||||
|
||||
if ($action == "update" && permission_exists('services_edit')) {
|
||||
if ($action == "update" && permission_exists('service_edit')) {
|
||||
$sql = "update v_services set ";
|
||||
$sql .= "service_name = '$service_name', ";
|
||||
$sql .= "service_type = '$service_type', ";
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
require_once "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
if (permission_exists('services_view')) {
|
||||
if (permission_exists('service_view')) {
|
||||
//access granted
|
||||
}
|
||||
else {
|
||||
@@ -141,7 +141,7 @@ if (strlen($_GET["a"]) > 0) {
|
||||
echo "<th>Status</th>\n";
|
||||
echo "<th>Action</th>\n";
|
||||
echo "<td align='right' width='42'>\n";
|
||||
if (permission_exists('services_add')) {
|
||||
if (permission_exists('service_add')) {
|
||||
echo " <a href='service_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
@@ -173,10 +173,10 @@ if (strlen($_GET["a"]) > 0) {
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo " <td valign='top' align='right'>\n";
|
||||
if (permission_exists('services_edit')) {
|
||||
if (permission_exists('service_edit')) {
|
||||
echo " <a href='service_edit.php?id=".$row[service_uuid]."' alt='edit'>$v_link_label_edit</a>\n";
|
||||
}
|
||||
if (permission_exists('services_delete')) {
|
||||
if (permission_exists('service_delete')) {
|
||||
echo " <a href='service_delete.php?id=".$row[service_uuid]."' alt='delete' onclick=\"return confirm('Do you really want to delete this?')\">$v_link_label_delete</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
@@ -193,7 +193,7 @@ if (strlen($_GET["a"]) > 0) {
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
if (permission_exists('services_add')) {
|
||||
if (permission_exists('service_add')) {
|
||||
echo " <a href='service_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
|
||||
Reference in New Issue
Block a user