Role capability behavior for course activity

Role capability behavior for course activity

by rajan p -
Number of replies: 11

We have created a new role with Role archetype as none,

Context types enabled for system, course and activity module.

Capability permission for creating new course and adding new quiz.

When the user login with the above mentioned role, i can still able to create other activities courses as well like scrom, pdf, url,etc.,

Here my concern is, even though we have given permission for "Quiz" activity type alone, it still allow all the default core activities as well. 

So, just need some detailed clarification over this point.

 


Average of ratings: -
In reply to rajan p

Re: Role capability behavior for course activity

by Dominique Palumbo -
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi,

I try it  on Moodle 3.7.1.

I create a new role from  the role Non-editing teacher. After that I add some grants like create quiz, add questions, Manage activities,...

And It's work I'm only able to create quiz in course. But I'm able to edit other existing activities (I realise that I've to remove some grants).  So maybe it's better to start from the student role and only add grants.


But I can confirm that the system to allow to add only quiz work.


add activity quiz only


Hope it's help.


Dominique.

In reply to rajan p

Re: Role capability behavior for course activity

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi Rajan,

what exactly do you mean with "Login with the role"?

A user who logs in has only the permission of the "Authenticated user" and if he is assigned to some system role, the definition of these roles. A user can be assigned to roles in different contexts. If a user is assigned to the "Editing teacher" role in a course he can do all things that are allowed for this role but only in this context.

So in your case perhaps the account you are testing with maybe is assigned to two roles. 1) The "Editing teacher" and 2) to your new created role. Both permissions are merged which means the account can create all activities.

Best regards
Andreas

In reply to Andreas Grabs

Re: Role capability behavior for course activity

by rajan p -

Andreas,

I have created a new custom role with configuration which I mentioned in my initial post. I have chooses "none" in the archetype, "system", "course" & "activity module" in context, and granted permission only to "create courses" and "add new quiz" but while creating a course, I can still able to see other default activity modules as well. But that should not be the case right? My concern is I want to see only quiz under the activity module drop-down while creating a course.

Hope you got it now.

In reply to rajan p

Re: Role capability behavior for course activity

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Rajan,

I've just attempted this and it all works as expected for me. However, two things:
1) By default you are given the "Teacher" role in the course still for the new course; and
2) Your new role will need the "moodle/course:manageactivities" capability too.
In reply to rajan p

Re: Role capability behavior for course activity

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators
Hi Rajan,

I know what you mean but I don't know what roles your user is assigned to in this course you are testing.
You can check this by looking into the userlist inside your course and clicking on the users name. This profile page shows you the effective roles of the user in this context.
I hope this helps.

Best regards
Andreas
In reply to Andreas Grabs

Re: Role capability behavior for course activity

by rajan p -
I am referring custom role with the config as,
We have created a new role with Role archetype as none,

Context types enabled for system, course and activity module.

Capability permission for creating new course and adding new quiz.

Refer my screenshot in reply for better clarifications.
In reply to rajan p

Re: Role capability behavior for course activity

by rajan p -

This is my custom role setting:

role-setting

Even though i have granted access to create only "quiz" activity, it displays all other default activity modules as well, is there anyway to restrict it only to "quiz" activity alone in the dropdown (refer below)activity.


Hope it will give better clarity

In reply to rajan p

Re: Role capability behavior for course activity

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators
Hi Rajan,

I am afraid, that it does not clarify your situation at all traurig. What you or someone who wants to help you need to know are the role assignments of the user you are testing with in the course context your screenshot is from.
That means you have to go to the userlist of that course and click on that name from the user you are testing with. This page shows you the effective role assignments of that user.
- Go into the course
- On the left side in your flat navigation go to "Participants". It will show you the list of enroled users.
- Click in the user list the Name of that particular user you are testing with. This shows you the profile page of that user on the course context.
- Look in the box "Course details". There is a list of roles the user take effekt in this course. These roles define the capabilities for the user in this course.

Maybe you can tel us these roles.

Best regards
Andreas
In reply to Andreas Grabs

Re: Role capability behavior for course activity

by rajan p -
Andreas,

"i want to create a user, who can able to only create courses & that too of anyone of the activity module (e.g. quiz, pdf, scrom) not all"
In my case, i want the user to create only "quiz" type of courses.

Let me summarize the case:

I want to create a one custom role, lets say, "Instructor" who can able to manage only courses in admin dashboard.

(to create "instructor" custom role, i did the configuration which i shared above by marking the archetype as "NONE")

So, i want that "Instructor" role user to create only courses for "quiz" activity type (i.e. under "site administrator" only "manage courses" options will be enabled and no other access granted.).

While creating a course, i want only the "quiz" activity type under "Type of activity" drop-down once i selected "single activity format" under format drop-down.

Is this possible? that is what my concern is.
In reply to rajan p

Re: Role capability behavior for course activity

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators
Hi,

I am sorry, that I can not help you. But you keep saying the same things we already know. And yes, it is possible. Take a look at the first answer by Dominique.

Best regards
Andreas