fix chech rights on startup
This commit is contained in:
+1
-1
@@ -443,7 +443,7 @@ class AssetTab extends CommonDBTM
|
||||
): void {
|
||||
echo "<div class='plugin-urbackup-inner-tabs'>";
|
||||
|
||||
$canWrite = Session::haveRight(self::$rightname, UPDATE) || Session::haveRight(self::$rightname, CREATE);
|
||||
$canWrite = Profile::canCurrentUser(UPDATE) || Profile::canCurrentUser(CREATE);
|
||||
|
||||
echo '<ul class="nav nav-tabs" id="urbackupTabs" role="tablist">';
|
||||
echo '<li class="nav-item" role="presentation">';
|
||||
|
||||
+5
-5
@@ -305,7 +305,7 @@ class Server extends CommonDBTM
|
||||
'datatype' => 'datetime',
|
||||
];
|
||||
|
||||
if (Session::haveRight(self::$rightname, UPDATE)) {
|
||||
if (Profile::canCurrentUser(UPDATE)) {
|
||||
$tab[] = [
|
||||
'id' => 14,
|
||||
'table' => self::getTable(),
|
||||
@@ -445,8 +445,8 @@ class Server extends CommonDBTM
|
||||
echo "</tr>";
|
||||
|
||||
$canEdit = $ID > 0
|
||||
? Session::haveRight(self::$rightname, UPDATE)
|
||||
: Session::haveRight(self::$rightname, CREATE);
|
||||
? Profile::canCurrentUser(UPDATE)
|
||||
: Profile::canCurrentUser(CREATE);
|
||||
|
||||
echo "<tr class='tab_bg_1'>";
|
||||
echo "<td>" . htmlspecialchars(__('API username', 'urbackup')) . "</td>";
|
||||
@@ -1152,7 +1152,7 @@ class Server extends CommonDBTM
|
||||
}
|
||||
}
|
||||
|
||||
$canWrite = Session::haveRight(self::$rightname, UPDATE) || Session::haveRight(self::$rightname, CREATE);
|
||||
$canWrite = Profile::canCurrentUser(UPDATE) || Profile::canCurrentUser(CREATE);
|
||||
|
||||
echo '<table class="table table-striped table-hover">';
|
||||
echo '<thead>';
|
||||
@@ -1219,7 +1219,7 @@ class Server extends CommonDBTM
|
||||
{
|
||||
global $DB;
|
||||
|
||||
$canWrite = Session::haveRight(self::$rightname, UPDATE) || Session::haveRight(self::$rightname, CREATE);
|
||||
$canWrite = Profile::canCurrentUser(UPDATE) || Profile::canCurrentUser(CREATE);
|
||||
|
||||
$apiStatus = (int) ($server->fields['last_api_status'] ?? 0);
|
||||
if ($apiStatus !== 1) {
|
||||
|
||||
Reference in New Issue
Block a user