michael-milette / moodle-filter_filtercodes

FilterCodes filter for Moodle enables content creators to easily customize and personalize course and site content using plain text tags (no HTML). For premium support, contact us at https://www.tngconsulting.ca/contact
https://moodle.org/plugins/filter_filtercodes
GNU General Public License v3.0
32 stars 43 forks source link

Request for comment: {ifhascapability capability}{/ifhascapability} tags. #206

Open michael-milette opened 2 years ago

michael-milette commented 2 years ago

This set of tags would enable you to conditionally display content on your Moodle LMS site based on the user's capabilities instead of their role.

Think would find useful? If so, share your thoughts (pros and cons) and include an example of how you would use it.

Best regards,

Michael

garetharnott commented 2 years ago

Hi Michael,

It might be useful to add greater flexibility to the existing suite. What do you mean 'capabilities' vs 'roles'? The only thing I can come up with is 'editing' vs 'non-editing'. I'm personally not so sure where I would use this.

best Gareth

michael-milette commented 2 years ago

Hi @garetharnott ,

As you know, Moodle users are assigned roles and can even have different roles depending on where they are in Moodle (called context).

Each role includes a collection of definitions which determine what a person can or cannot do/access in that context.

For example, instead of checking to see if a person is a teacher and checking to see if the person is a manager, you could use this tag to simply see if they can do something regardless of the name of their role.

I think the following example explains it well:

Given your role (e.g. teacher) within the current context (e.g. the current course), do you have permission (e.g. yes or no) for a specific capability (e.g. allowed to edit the course).

Moodle has hundreds of these capabilities which can be configured in each role and in many components such as courses and blocks. Sometimes even in the course activity itself.

List of capabilities: https://docs.moodle.org/en/Category:Capabilities

It is definitely an advanced topic but you can learn more about this by going to:

https://docs.moodle.org/en/Permissions

Hope this helps.

Best regards,

Michael

garetharnott commented 2 years ago

I see - my gut feeling is that this would be an extreme level or rather esoteric filtercode for the general users. I think admins might find it useful, but at the course facilitator level the 'roles' tags seem to be more intuitive.

best Gareth

michael-milette commented 2 years ago

Thanks for sharing your thoughts Gareth. Much appreciated.

acquaalta commented 2 years ago

Hi Michael, I agree with Gareth that the general users won't find much use for it, BUT... It could be wonderful for administrators. If you'll decide to add this feature, please add also a "if not" version of the tag, because I can think on use cases where administrators would want to show some text to users that don't have a specific capability, in order to explain to them why they don't see something or why they can't use that something.

Thanks

michael-milette commented 2 years ago

Thanks for sharing your thoughts @acquaalta . Much appreciated.

Best regards,

Michael