Skip to content

Commit

Permalink
fix rights in computer tabs - see #3218
Browse files Browse the repository at this point in the history
  • Loading branch information
yllen authored and trasher committed Nov 29, 2017
1 parent 92f9835 commit 1c6c9dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion inc/computerantivirus.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static function getSearchOptionsToAdd() {
function showForm($ID, $options=array()) {
global $CFG_GLPI;

if (!Session::haveRight("computer", UPDATE)) {
if (!Session::haveRight("computer", READ)) {
return false;
}

Expand Down Expand Up @@ -262,6 +262,7 @@ function showForm($ID, $options=array()) {
echo "<td colspan='2'></td>";
echo "</tr>";

$options['canedit'] = Session::haveRight("computer", UPDATE);
$this->showFormButtons($options);

return true;
Expand Down
5 changes: 3 additions & 2 deletions inc/computerdisk.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function defineTabs($options=array()) {
$ong = array();
$this->addDefaultFormTab($ong);
$this->addStandardTab('Log', $ong, $options);

return $ong;
}

Expand Down Expand Up @@ -144,7 +144,7 @@ static function cloneComputer ($oldid, $newid) {
function showForm($ID, $options=array()) {
global $CFG_GLPI;

if (!Session::haveRight("computer", UPDATE)) {
if (!Session::haveRight("computer", READ)) {
return false;
}

Expand Down Expand Up @@ -209,6 +209,7 @@ function showForm($ID, $options=array()) {
Html::autocompletionTextField($this, "freesize");
echo "&nbsp;".__('Mio')."</td></tr>";

$options['canedit'] = Session::haveRight("computer", UPDATE);
$this->showFormButtons($options);

return true;
Expand Down

0 comments on commit 1c6c9dc

Please sign in to comment.