Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by Tim TO. -
Number of replies: 12

Hi all,

We're trying to accomplish this (and need some help): only display certain courses to certain roles.

 

1. So by default, all courses are set to visibility:hide.

2. We tested by setting a custom permissions override for the role "Course 1 Visibility" for the course "Course 1".

3. When logging in as a user assigned to that role, I am still not able to view "Course 1" in my courses navigation.

4. We'll then turn on self-enrollment to allow users to have access to certain courses with the ability to enroll and get active.

Any ideas why this isn't working as intended?

All help is appreciated!

Average of ratings: -
In reply to Tim TO.

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

How did you create this role and how did you assign it?

In reply to Mary Cooch

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by Tim TO. -

Hi Mary,

We created the role via going into "Define Roles" and made sure it included the "system" context so we could assign users to it globally. So we're assigning a test user to that role via the "Assign System Roles."

I'm then going into the particular course and setting a permissions override for this role so that they would (theoretically) be able to view. So all courses are turned off, and then the idea would be to go into the course and turn on visibility manually for the desired roles.

I refresh the page when testing as logged into the user who is assigned to the appropriate role that should be gaining access to the course in the "course list", but the course I enabled isn't showing up still. Also if I try to go to the course URL, I get the message "This course is currently unavailable to students". (Not sure if this is causing an issue in the mix? Although the single category that holds all the courses is turned on to be visible.)

Can you confirm that the "course:view" capability is the one I should be using, and that it is intended to work this way? Just wanting to make sure my approach is solid, as I believe it is "in theory". Just need to figure out why it's not allowing users of this role to view the courses that I'm overriding and "allowing".

Thanks for any help you can offer!

//Timothy

In reply to Tim TO.

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by Stuart Mealor -

Well, the message "This course is currently unavailable to students" indicates the Course is hidden from the logged in user.

Quick look at: http://docs.moodle.org/25/en/Capabilities/moodle/course:view

  • This capability allows a user to view a course without being enrolled in it.
    • Comment: So this capability isn't actually connected to the enrolment process - which means it is probably not going to be a solution (or only part of the solution) if you are using this route to control access to Courses
  • Roles with this capability set to allow are available for Other users to be assigned to.
  • Users with this capability are NOT listed as course participants.
    • Comment: If they are not listed as Course Participants then this would explain why a user with this role doe not see the Course in their list
  • The default manager role has this capability set to allow. For all other default roles, the capability is not set.
    • Comment: So the intention of this capability is simply to allow a user to view the contents of a Course without being enrolled - which isn't where I think you are heading with this idea ?

My understanding is that even if the users have this capability, it's the enrolment method, and the fact that that Courses are hidden, which will control which Courses the user will see.

Depending on how your site is setup (e.g. Courses and Categories), and how your users are being organised, you might find it easier to use Categories and Category enrolments ?

Without spending some time testing this for real, and without knowing exactly how you think the site should operate, it's difficult to say more sad

However, you might think about copying the Manager role, which has this capability already setup, and then working out what you need to take away from the role to achieve what you want?

However, I still think trying to give a role at site level access to hidden courses is a convoluted approach, and might never work.

Average of ratings: Useful (1)
In reply to Stuart Mealor

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

I have to say I agree with Stuart, and especially his last line...

In reply to Stuart Mealor

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by Tim TO. -

Hello Stuart/Mary,

First off, thanks for any and all help you are providing. I'm not sure I understand yet what the best non-convoluted approach would be, as my goal is simply this:

  • I have several custom roles, and each role needs to have visibility to certain courses. They should simply "see" the course in their course list and be able to self-enroll (not seeing the course content without having enrolled).
    • How would you go about solving this?
  • I was thinking the most straight-forward approach would be to turn off all visibility for courses (all existing within one category), and then at a per-course level turn on access to the respective role(s). In my limited perspective, this would seem much simpler than going the route of setting the roles to a manager role architecture base, and then turning "off" all of the other privileges within each
  • My setup is this:
    • One category, 10 courses in this category
    • All courses are set to hidden, and I'm trying to make them "viewable" in the course list for certain roles by going into the course and setting the role's overriding permission in "course:view" to "allow".
    • Custom roles (created from the "student" architecture base), where each should see a different list of courses they can manually-enroll in.
    • Users are associated at the site/system level to a role

Questions

  • Can anyone recommend a way to do this that they know will work? It seems a common need to be able to present a different list of courses to different roles, no?
  • Can I provide any more information on my setup that would allow you to help provide some practical changes in order to accomplish this?

 

Thanks,

Timothy

In reply to Tim TO.

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

It seems to me you are trying to do the kind of multi-tenancy thing that doesn't yet exist in standard Moodle (I mean, certain courses only visible to certain users) I believe there are commercial products out there that do similar, and one of them is soon to be released to the community - have a look here to see if it might suit your purposes https://moodle.org/mod/forum/discuss.php?d=245245#p1063545

In reply to Mary Cooch

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by Tim TO. -

Hi Mary,

So the only recommendation you have is to move onto another solution? Surely there's got to be a way to configure this within Moodle...no? I was thinking the capabilities (such as course:view) were meant for things just like this...?

 

I'm still not sure why my "theory"/approach isn't working. Is that not what "course:view" is intended for? If not, what is it intended for?

In reply to Tim TO.

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

Well I think Stuart's appraisal of course:view is probably pretty accurate in why it doesn't seem to work for you. If I can get some time I  will try to see if I can either replicate your role or make a new one or try in some way to achieve what you want, but I can't promise anything - perhaps we need to look at it from a different angle.

In reply to Tim TO.

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by ben reynolds -

I'd like to take another approach. I think you are trying to express what you want to achieve in Moodle speak

I think, if you just say what you want to achieve without Moodle speak, you might have a better chance of getting there.

 

Say it another way.

In reply to ben reynolds

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by Tim TO. -

Hey Ben,

I appreciate the input. Without Moodle speak, I simply want to have a group of users have limited access to certain courses. So I'll have a range of courses that should only be available to certain users. Do you know of a way to accomplish that? Maybe it is at the "category level" instead of the "course level"...I don't know.

Any ideas?

In reply to Tim TO.

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by Mary Cooch -
Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Testers Picture of Translators

And it is essential that they self enrol? (I mean, are there presumably so many that enrolling them manually or issuing enrolment keys is not an option?)

In reply to Tim TO.

Re: Help with Course:View -> trying to limit course visibility to all, and manually allow certain roles to view a course (via permission override)

by ben reynolds -

Category has some possibilities, but you could also use a meta course so, once enrolled in the meta course, users can get to the a cluster of child courses. Warning: I still don't have my head entirely wrapped around this concept.

But I think Mary's question is a good one. Must it be self-enroll? We use a csv to upload our users on a daily basis with very little pain.