Issue Details (XML | Word | Printable)

Key: MDL-8522
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Petr Skoda
Reporter: Petr Skoda
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Add role reset button into role definition form

Created: 15/Feb/07 06:31 AM   Updated: 01/Jun/07 10:23 PM
Return to search
Component/s: Roles
Affects Version/s: 1.7
Fix Version/s: 1.8, 1.9

Issue Links:
Relates
 

Participants: Helen Foster and Petr Skoda
Security Level: None
QA Assignee: Helen Foster
Resolved date: 22/Mar/07
Affected Branches: MOODLE_17_STABLE
Fixed Branches: MOODLE_18_STABLE, MOODLE_19_STABLE


 Description  « Hide
The default capability settings for roles are sometimes changing between releases, there is no proper documentation yet - admins are complaining.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 04/Mar/07 06:33 AM
fixed in cvs

Helen Foster added a comment - 06/Mar/07 03:51 AM
Hi Petr,

Just testing this improvement and found it confusing to have the role reset button appear for new roles.

For example:

1. Create a duplicate teacher role and change some permissions.
2. Click the role reset button and obtain the message "Are you sure that you want to reset role "Teacher copy 1 (editingteache_1)" to defaults?"
3. Choose Yes.

Expected result: Role reset
Actual result: Nothing changed

Is it possible to hide the role reset button for new roles?


Petr Skoda added a comment - 07/Mar/07 03:32 AM
I have changed the strings a bit, it works as following:
  • If role has legacy type selected - it is reset to default permissions for legacy type
  • If no legacy selected - all permissions are cleared

please help me with the languages strings so that ppl understand that

$string['resetrolesure'] = 'Are you sure that you want to reset role \"$a->name ($a->shortname)\" to defaults?<p></p>The defaults are taken from the selected legacy capability ($a->legacytype).';

$string['resetrolesurenolegacy'] = 'Are you sure that you want to removed all permissions defined in this role \"$a->name ($a->shortname)\"?';


Helen Foster added a comment - 07/Mar/07 04:51 AM
Hi Petr,

I tested your changes using the duplicate teacher role example above and found that the reset button worked exactly as expected

However, I think the role reset button for new roles is still confusing.

Example 2:

1. Create a new role allowing moodle/legacy:editingteacher only.
2. Click the role reset button and obtain the message "Are you sure that you want to reset role "new role (new2)" to defaults? The defaults are taken from the selected legacy capability (editingteacher)."
3. Choose Yes.

Result: All legacy editingteacher permissions are set, even though they weren't before!

I still think it would be preferable if the role reset button is hidden for new roles.

Isn't it simpler to just delete any new role with no legacy selected rather than having to reset it to clear all permissions?


Petr Skoda added a comment - 07/Mar/07 06:08 AM
What if we call the button "Set defaults" if legacy present and "Reset" if no legacy set?

Helen Foster added a comment - 08/Mar/07 03:20 AM
The more I play around with role reset, the more I wish it could be disabled for new roles. Otherwise it always gives unexpected results.

However, if this is just not possible then perhaps the language strings could read:

$string['resetrolesure'] = 'Are you sure that you want to reset role \"$a->name ($a->shortname)\" to defaults?';

$string['resetrolesurenolegacy'] = 'Are you sure that you want to clear all permissions defined in the role \"$a->name ($a->shortname)\"?';


Petr Skoda added a comment - 22/Mar/07 09:54 PM
The reset button has now different label and confirmation if legacy type set.
going to file a new report for legacy roles confusion..

thanks for the feedback


Helen Foster added a comment - 01/Jun/07 10:23 PM
Closing, since everyone seems happy with the reset to defaults button. Thanks Petr