Note: You are currently viewing documentation for Moodle 1.9. Up-to-date documentation for the latest stable version is available here: Block permissions.

Block permissions: Difference between revisions

From MoodleDocs
No edit summary
 
(9 intermediate revisions by 6 users not shown)
Line 1: Line 1:
=Hiding blocks from certain users=
==Block capabilities==
{{Moodle 1.9}}
 
From Moodle 1.9 there is a [[Capabilities/moodle/block:view|moodle/block:view]] capability which allows control of who can view blocks from the roles system.
*[[Capabilities/moodle/site:manageblocks|moodle/site:manageblocks]]
===Example: Hiding course block from guests===
*[[Capabilities/moodle/my:manageblocks|moodle/my:manageblocks]] (from 1.8 onwards)
* Login as a user who has permission to control blocks on the page you are interested in (e.g. teacher/admin)
*[[Capabilities/moodle/tag:editblocks|moodle/tag:editblocks]] (from 1.9 onwards)
* At the top of every block there should be a face-and-mask icon, the mouseover tooltop says "assign roles", click this icon on the top of the course block
*[[Capabilities/moodle/block:view|moodle/block:view]] (from 1.9 onwards)
* Click on "override roles" to switch to viewing role overrides
 
* Choose the "Guest" role from the list of roles
==Hiding a block from guests==
* Change the [[Capabilities/moodle/block:view|View Block]] permission to prevent
 
* Save changes
{{Moodle 1.9}}In Moodle 1.9 onwards, the capability [[Capabilities/moodle/block:view|moodle/block:view]] allows control of which users can view blocks. This feature works with all blocks, including contributed blocks.
* Guests should no longer be able to see the course block
[[Image:Recent activity block header.png|thumb|Recent activity block header]]
To hide a particular block from guests:
# On the course homepage, click the "Turn editing on" button at the top-right of the page.
# Access the assign roles page via the assign roles icon (a face and mask) in the header of the block to be hidden.
# Click the "Override permissions" tab.
# Select the guest role.
# Set the capability [[Capabilities/moodle/block:view|moodle/block:view]] to prevent.
# Click the "Save changes" button.
 
Note: By default, only administrators are able to override permissions. Instructions on enabling teachers to override permissions can be found in [[Override permissions]].
 
==Displaying a block to selected users only==
 
#Ensure you have hidden your block from non-logged in users as above
#In site administration>users>permissions>define roles, create a new role such as "front page block viewer"
#Click the "Turn editing on" button on your front page
#Click the "assign roles " icon on your block.
#Click the blue words of your new role. They link to the assign roles page. Choose who you want to allow to see this block (such as your teachers) by moving them from the right hand box to the left.
#Click the "Override permissions" tab
# For your new role, press the "allow" button to allow them to view this block
# For the authenticated user, press the "prevent" button to prevent them seeing this block
#Click the "Save changes"button.
 
==See also==
 
*[http://www.youtube.com/watch?v=x2zgpjSsbbM Video showing how to hide a block from guests in Moodle v1.9]
*[http://www.youtube.com/watch?v=i3pGqkvARUU Video showing how to display a block to a selected group of users in Moodle v 1.9]
 
[[Category:Roles]]
[[Category:Block]]
[[Category:Block]]
[[de:Block-Rechte]]
[[eu:Blokeen_baimenak]]
[[fr:Permissions des blocs]]

Latest revision as of 21:32, 10 October 2009

Block capabilities

Hiding a block from guests

Moodle1.9

In Moodle 1.9 onwards, the capability moodle/block:view allows control of which users can view blocks. This feature works with all blocks, including contributed blocks.

Recent activity block header

To hide a particular block from guests:

  1. On the course homepage, click the "Turn editing on" button at the top-right of the page.
  2. Access the assign roles page via the assign roles icon (a face and mask) in the header of the block to be hidden.
  3. Click the "Override permissions" tab.
  4. Select the guest role.
  5. Set the capability moodle/block:view to prevent.
  6. Click the "Save changes" button.

Note: By default, only administrators are able to override permissions. Instructions on enabling teachers to override permissions can be found in Override permissions.

Displaying a block to selected users only

  1. Ensure you have hidden your block from non-logged in users as above
  2. In site administration>users>permissions>define roles, create a new role such as "front page block viewer"
  3. Click the "Turn editing on" button on your front page
  4. Click the "assign roles " icon on your block.
  5. Click the blue words of your new role. They link to the assign roles page. Choose who you want to allow to see this block (such as your teachers) by moving them from the right hand box to the left.
  6. Click the "Override permissions" tab
  7. For your new role, press the "allow" button to allow them to view this block
  8. For the authenticated user, press the "prevent" button to prevent them seeing this block
  9. Click the "Save changes"button.

See also