[#846] Change of Mediawiki rights are not saved

Description

Summary:

Detailed description

Hi,

we run FusionForge with the Mediawiki plugin. I created an additional role in the project and tried to set the Mediawiki write rights to full rights (create, move, etc.) and then I click save and get a confirmation. But it actually does not save this. The role remains with rights, where it can only change existing sites. I can not see any errors in /var/log/apache and /var/log/fusionforge. How can I debug this?

Regards, Michael

General Information
Submitted by:
Michael Kluge
Date Submitted: 2017-02-02 10:09
Last Modified by: Nobody
Last Modified: 2017-11-02 20:00
Date Closed: 2017-02-28 12:20
Permalink: https://fusionforge.org/tracker/a_follow.php/846
Actions
Internal Fields
Data Type: Bugs
Assigned to: Nobody (None)
State: Closed
Priority: 3
Extra Fields
Resolution:
Fixed
Severity:
normal
Target Release:
6.0.5
Follow-up tabs
Message  ↓
Date: 2017-07-04 05:54
Sender: Michael Kluge

The issue is back, but only with custom roles. When I look at the output that you suggested, then I can see that the roles are actually edited by the DB requests. For example, I can set different settings for the mediawiki plugin, and the roles are edited in the database. But the roleedit.php does not reflect the modified settings. Also not, if I reload the page. Maybe there is a bug in

common/mediawikiPlugin.class.php ?

Date: 2017-02-27 10:15
Sender: Michael Kluge

Problem is solved in 6.0.5+201702202128-1.

Date: 2017-02-02 14:40
Sender: Franck Villaume

Hi,

this one is not easy to debug unless to dig into the code.

Role permission update is done using prepared sql queries. File to look into: ~/common/include/RBAC.php function update($rolename,$data,$checkperms=true,$update_sys=true)

Line 839 & 840 you have: 839 dbprepare ('UPDATE pforolesetting SET permval=$4 WHERE roleid=$1 AND sectionname=$2 AND refid=$3', 840 'updatepforolesetting');

Then you have this loop: 850 foreach ($data as $sect => &$refs) { 851 foreach ($refs as $refid => $value) { 852 if (!isset($this->permsarray[$sect][$refid])) { 853 // new permission 854 dbexecute('insertintopforolesetting', 855 array($roleid, $sect, $refid, $value)); 856 } elseif ($this->permsarray[$sect][$refid] != $value) { 857 // changed permission 858 dbexecute('updatepforolesetting', 859 array($role_id, $sect, $refid, $value)); 860 } 861 }

check line 858 for updating permission. $value should have the new permission value you set.

$value is from a multi-dimensional array: $data['section']['refid'] = $value $data is built in the page ~/project/admin/roleedit.php

Echoing $value on line 857 will help you to know which value will be set by the dbprepare query: updatepforolesetting To understand the $value, you have to look in Mediawiki Plugin main class, and look at the hook "role_get"

PS: there is a hook: role_update. No need to look for it. It is not used nor implemented by any plugin.

No attached documents

No related commits.

Field Old Value Date By
status_idOpen2017-02-28 12:20
Franck Villaume
close_dateNone2017-02-28 12:20
Franck Villaume
Target ReleaseNone2017-02-28 12:20
Franck Villaume
ResolutionNone2017-02-28 12:20
Franck Villaume

No relations found.