Note: You are currently viewing documentation for Moodle 2.5. Up-to-date documentation for the latest stable version of Moodle may be available here: Auto role assignment block.

Auto role assignment block: Difference between revisions

From MoodleDocs
(New page: Automation of role assignment process will enable permission managing for momentary cases and on “by user” basis. The main idea is to enable the system to reassign roles of participant...)
 
No edit summary
Line 1: Line 1:
Automation of role assignment process will enable permission managing for momentary cases and on “by user” basis. The main idea is to enable the system to reassign roles of participants based on actions they undertake. For example: the student passing the test is denied any communication options, but retains them upon completion. This approach would require significant effort from administrator with current manual-only role and permission management system.
Automation of role assignment process will enable permission managing for momentary cases and on “by user” basis. The main idea is to enable the system to reassign roles of participants based on actions they undertake. For example: the student passing the test is denied any communication options, but retains them upon completion. This approach would require significant effort from administrator with current manual-only role and permission management system.


===User interface===
=== Rule structure ===
====Block appearance====
Rule changes the permissions of the user depending on the event in the system.
The block contains two links:
 
# Link to settings page  
Rules structure:
# Link to block help page
 
====Settings page====
Required parameters:
The settings page contains:
* Name of rule;
# List of existing rules, each represented with:
* Type of rule;
## Link to corresponding rule's editing form
* A role that will be assigned to the user when the rule will trigger;
## Option to disable
* Roles that are permitted a transition;
## Option to mark the rule for removing
* Elements of the course for which the rule is triggered.
# Option to add new rule
 
# Option to delete rules marked for deletion
Optional parameters may be added depending on the type of rule.
====Rule settings====
 
Rule settings consist of:
=== Block appearance ===
# Rule name
The block contains three links:
# Event, upon which the rule takes effect (note: this is not the “event” developers are familiar with, but the events, understandable by users)
# Link to add rule page  
# List of roles, to which this rule is applicable
# Link to current rules page
# New role being set for user as a result of event
# Link to active rules page
# Recurrence flag – set if default role is to be returned upon completion of activity (if possible).
# Current role of user in course
[[Image:block_role_assign.jpg]]
=== Add rule page ===
In this page you can add new rule:
Step 1:
* you must input name of rule
* you must select type of rule
 
click 'next'.
 
[[Image:new_rule.jpg]]
 
Step 2:
* you must select 'new role' (this role will receive a user when a rule is triggered)
* you must select 'allow roles' (this user roles on this course, which allowed triggering rules)
* you must select elements of course for this type of rule, which rule is triggered
 
click 'save'.
 
[[Image:add_edit_rule.jpg]]
 
=== Current rules page ===
On this page you can see rules that already exist. On this page you can go to edit page of rule; delete rule (if you have the necessary permissions).
 
[[Image:current_rules.jpg]]
 
=== Active rules page ===
 
On this page you can see active rules.
 
[[Image:active_rules.jpg]]
 
=== DB structure ===
 
[[Image:database.jpg]]
 
* block_role_assign_rules - table for rules:
* block_role_assign_instances - table with active rule
* block_role_assign_values - table for optional parameters
* block_role_assign_roles - table for allow roles
* block_role_assign_types - table where sets type of rule
* block_role_assign_tasks - table with types of rule
 
=== Capabilities ===
 
* block/role_assign:addrule - ability add rule
* block/role_assign:editrule - ability edit rule
* block/role_assign:deleterule - ability delete rule
* block/role_assign:viewactiverules - ability view page "active rules"
* block/role_assign:viewcurrentrules - ability view page "current rules"

Revision as of 10:22, 27 December 2013

Automation of role assignment process will enable permission managing for momentary cases and on “by user” basis. The main idea is to enable the system to reassign roles of participants based on actions they undertake. For example: the student passing the test is denied any communication options, but retains them upon completion. This approach would require significant effort from administrator with current manual-only role and permission management system.

Rule structure

Rule changes the permissions of the user depending on the event in the system.

Rules structure:

Required parameters:

  • Name of rule;
  • Type of rule;
  • A role that will be assigned to the user when the rule will trigger;
  • Roles that are permitted a transition;
  • Elements of the course for which the rule is triggered.

Optional parameters may be added depending on the type of rule.

Block appearance

The block contains three links:

  1. Link to add rule page
  2. Link to current rules page
  3. Link to active rules page
  4. Current role of user in course

block role assign.jpg

Add rule page

In this page you can add new rule: Step 1:

  • you must input name of rule
  • you must select type of rule

click 'next'.

new rule.jpg

Step 2:

  • you must select 'new role' (this role will receive a user when a rule is triggered)
  • you must select 'allow roles' (this user roles on this course, which allowed triggering rules)
  • you must select elements of course for this type of rule, which rule is triggered

click 'save'.

add edit rule.jpg

Current rules page

On this page you can see rules that already exist. On this page you can go to edit page of rule; delete rule (if you have the necessary permissions).

current rules.jpg

Active rules page

On this page you can see active rules.

active rules.jpg

DB structure

database.jpg

  • block_role_assign_rules - table for rules:
  • block_role_assign_instances - table with active rule
  • block_role_assign_values - table for optional parameters
  • block_role_assign_roles - table for allow roles
  • block_role_assign_types - table where sets type of rule
  • block_role_assign_tasks - table with types of rule

Capabilities

  • block/role_assign:addrule - ability add rule
  • block/role_assign:editrule - ability edit rule
  • block/role_assign:deleterule - ability delete rule
  • block/role_assign:viewactiverules - ability view page "active rules"
  • block/role_assign:viewcurrentrules - ability view page "current rules"