assigning users to a custom role

assigning users to a custom role

Sterling Uy發表於
Number of replies: 13

moodle 2.0.3

I created a custom role, however it is not showing in any "assigned role" option.

I defined a role in "administration-users-permissions-define roles"

I defined a visitor role with very limited access only, (access a forum in my front page) means all "permissions" are ticked 'prohibited' except for some forum options which was set to 'allow".

I created a user called 'visitor' and want to assign a role to this user as visitor "role" in the "front page setting-users-permissions-assign roles"

Somehow my  'user defined role' is not showing up in the 'front page role', it is only showing manager, teacher, non-editing teacher and student.

I checked "administration-frontpage-frontpage settings" and the "default frontpage role is "vistor" role that I created.

My objective is to have guests users be able to post in my front page forum (which moodle 'guest' user cannot). I achieved this first by assigning a role of 'student' to my 'visitor' user in the forum's "forum administration" blocks and tweaked 'permissions' of the student role.

However the "naviagtion" and "settings" block is accessable by the 'visitor' user so I need to disable them. By creating a new 'visitor' role and disabling everything except some forum options, I was expecting this to show up on role assignments. Is there anyway to customize the 'role assingment' page/drop box to not only display 'manager', 'teacher', 'non-editing teacher' and 'student' but add a user defined role?

Thank you for anyone who could help, I searched this forum for hours already and cannot find any solution.

Sterling

評比平均分數:Useful (1)
In reply to Sterling Uy

Re: assigning users to a custom role

Marty Soupcoff發表於

So I tried to keep track of everything you did but still got lost 微笑. What I think you are trying to do though is assign a user to the new role that you just created. Is that correct?

If so, you may have forgot to allow the role you are at to assign someone to that role. If you go Site Admin > Users  > Permissions > Define Roles > Allow role assignments tab (located at top of page) or go to http://XXXXXXXXX/admin/roles/allowassign.php (insert your web address for the X's. This is where you decide which roles can assign other users to which roles. For example, teachers can assign only assign other users to non-editing teachers, students and guests while admins can do all. Make sure the box in the Administrator ROW and the COLUMN of the role you just created is checked and save your changes.

Moodle Docs - Allow Role Assignments

Note: I only have 1.9.11 so I can't verify that it is the same in 2.0

In reply to Marty Soupcoff

Re: assigning users to a custom role

Sterling Uy發表於

Hello Marty,

Lol, that is what I mean, Thank you for your help, perhaps pictures can say a thousand words.

I'll post 2 replies since each one can only post a max of 100kb and I have 2 pictures show you

Attached is an allowrole.jpg

am logged as administrator but there is no role assignment for administrator?

In the "manage role" tab, 'administrator' also does not appear.

附件 allow role.jpg
In reply to Marty Soupcoff

Re: assigning users to a custom role

Sterling Uy發表於

Hi Marty,

2nd picture is the front page where I want 'visitor' to appear,

am logged in as administrator but 'visitor' role is not showing?

btw, in the previous picture, I also created a user with manager role and ticked "visitor". Logged in as user-manager to find out if it would appear, but did not.

I went to find "http://XXXXXXXXX/admin/roles/allowassign.php" using my file manager and only found "assign.php" and "allow.php" but no "allowassign.php".

I hope this explains it more clearly.

I just don't know if I did it the wrong way or did I miss something here?

thank you again.

Sterling

附件 frontpage.jpg
In reply to Sterling Uy

Re: assigning users to a custom role

Sterling Uy發表於

Hello everyone,

Sorry for bumping this up, but does anyone have any idea how I could solve this?

I don't know if bumping up is allowed here since I have not seen people do it . I do apologize for it though.

Thank you in advance.

Sincerely,

Sterling

In reply to Sterling Uy

Re: assigning users to a custom role

Marty Soupcoff發表於

As mentioned before, you are running 2.0.x while my university still uses 1.9.11 so things look a little different and makes it a little tougher to diagnose.

So are you trying to assign a specific person this role or trying to set this role for any user who comes to your page will have this role without having to log in?

In reply to Marty Soupcoff

Re: assigning users to a custom role

Sterling Uy發表於

Hello Marty,

Thank you for replying.

I'm planning to have 'visitors' participate in selected areas in the front page (forum) and eventually in some courses.

I read somewhere that suggested a creation of a 'guest' user and name it visitor so replace the moodle 'guest' role so that specific roles can be assigned to it. http://moodle.org/mod/forum/discuss.php?d=69674 suggested by Helen Foster (one of Moodle's core developer)

The objective is to invite observers and allow them to give feedback and comments on the site and its courses and activities. These observers are people who might have a significant impact on the expansion of the current site or a creation of new sites to serve as their own LMS. Assigning them individual user names and accounts might be impractical since these observers would come from different organizations or schools and might be anyone.

By using a custom role, I could identify only areas this 'visitor' can access and create only one user with one password.

Anyway, I'm still looking for a possible solution and appreciate your response and help. I know its probably buried deep somewhere in this LMS otherwise I see no point in allowing a custom role and not be able to assign it.

Sterling

In reply to Sterling Uy

Re: assigning users to a custom role

Marty Soupcoff發表於

I believe what Helen was describing was creating a user account and then making the log in for that account public for all 'visitors' to then see and share. There would be no way of then tracking who was the 'visitor' at which time though because it is a shared account. I'm not sure if that is what you want though as you won't be able to track who posted what.

And these may be a dumb question, but did you make sure to save your changes when you were on the Allow Role Assignments page? Because with the checkmark in the Manager Row - Visitor column, the Manager role should be able to assign a user at the Front Page level. And I see that you pointed out that you are an administrator in one of the images but it does not show the administrator row so I still have second thoughts that you actually may be at the Manager role instead.

I also found this article on the Front Page Settings that describes how you can set a user or all logged in users to a certain role when looking at the Front Page. Furthermore, you can see in the image in the Context section of the Assign Roles Moodle Doc, it shows the hierachy of Moodle. So making a 'Visitor' role may not be best as you mentioned that you eventually may want them to enter certain courses. You could always set up the Email-based self-registration (I believe this is what Moodle.org uses for us to participate in these forums) for users to set up their own user accounts. And then set the Front Page setting default role to student. At least I think that would all work 微笑

Happy Moodling!

In reply to Marty Soupcoff

Re: assigning users to a custom role

Sterling Uy發表於

Yes Marty, the same as what Helen is describing, these observers will more or less close their comment with their names, but it does not really matter if they don't. What is important is their observations and suggestions. I know this can lead to abuse from anybody, but the feature will be only active when needed, concerened people advised and new password created.

you said "but did you make sure to save your changes when you were on the Allow Role Assignments page?"

微笑 I beleive there is no dumb question here, yes I have tried both, that screen is logged in as administrator, and I also logged in with manager privilages. That is why I'm wonder why the administrator row is not showing as you mentioned.

I think I have read that article and somehow feel that it would create some problems specially within the courses.

I actually used 'front page default role' to student but restricting them through 'role exception'  does not give me options to disable access similar to 'define role'. and those restrictions would also apply to actual students.

With multiple accounts, each one of them will be given enrollment keys resulting to multiple extraneous accounts, having assigned them to 'student' roles, similar to 'actual' students, they can have access to areas in the course that is exclusive only for students. It would also affect the eventual grade system if they mistakenly tried to answer a quiz or rate a forum post, (I'll be swamped with emails of angry teachers). I feel safer if a role I create restricts them and not 'pray' that they don't touch them. and define role is the answer, problem is....

In reply to Sterling Uy

Re: assigning users to a custom role

Marty Soupcoff發表於

What about if you create a new user account and assign that user account to the student role in the Front Page Assign Roles. This will allow that user to post in the forum on front page but not access any of the courses as they are not enrolled in the course (if the course allows guest access though they will be able to get in). Regular students in courses will not be able to post to that forum on the front page though as they would need to be added at the Front Page Assign Roles.

If in the future, you would like this new user account to view courses, you can simply add them to that course.

I think the reason I'm having trouble figuring this out is that you are on 2.0 and some of the settings are different than in 1.9. We'll solve it eventually though!

Happy Moodle Logooodling!

In reply to Marty Soupcoff

Re: assigning users to a custom role

Sterling Uy發表於

Hi Marty,

Appreciate your help even though we aren't running the same versions.  微笑

I have already done that and it works, problem is that the navigation block and settings block cannot be deactivated through 'role exceptions', anyone can log in and change user information (since I will just be posting in the forum the username and password). This lead me to 'define a role' so that block access can be controlled. (Resulting to this thread)

I'm very concerened about unauthorized extraneous access so as to preserve the 'sanity' of the site.

However if I really have no option left, I would be settling for 'the least of all evils'.

Thank you.

In reply to Sterling Uy

Re: assigning users to a custom role

Marty Soupcoff發表於

I think the big problem was that since I'm on a different version, didn't see the Navigation and Setting blocks as those are new to 2.0. I can't verify this but you may not be able to hide those blocks. You should be able to override the permissions of a role though that doesn't allow them to change the username or password.

At this point I think you may have to settle for whichever of the two evils you decide is closer to your goal. In my opinion, I don't think it would be possible to keep the 'sanity' of the site when you are looking to allow users to post anonymously. Sorry I can't help more. Maybe another 2.0 user will jump in though.

In reply to Sterling Uy

Re: assigning users to a custom role

Marty Soupcoff發表於

Saw this discussion pop-up in my email this morning. Forgot about hiding it at the site wide level but it's another option for you. It would hide it from everyone though.

In reply to Marty Soupcoff

Re: assigning users to a custom role

Sterling Uy發表於

Hello Marty,

It finally worked!

Thank you for your last post/suggestion, it lead me to a sequence which made it work.

For the benefit of other people who will be reading this, I will post how I did it. (Moodle 2.0.3)

Like before, I created a role and named it visitor. 'site admin>users>permissions>define roles' and 'allowed' only several options in the forum.

Note: in the define role, you can practically 'allow/prevent/prohibit/' anything, the list is very long, almost got cross-eyed and my forefinger ached from clicking all the prohibit option. My suggestion to the developers if they can put an option to toggle a group/category or sub group/category that way users won't need to toggle individually.

In the 'context type' area, I ticked all instead of just 'system', just to make sure it would come out, (if someone could post here which is the right choice everyone reading this would probably appreciate it.) I tried ticking only 'activity module' since I am going to use a forum but the visitor 'role' didn't appear.

Also created a user called 'visitor'.

I went to 'settings>front page settings>users>permissions>assign roles' and as expected saw the visitor 'role' that was missing previously. (please refer file attachments I posted previously)

I then assigned the 'user' visitor to the 'role' visitor.

I 'turned editing on' and clicked on 'assign role', the visitor 'role' option is displayed, clicking on it, I then assigned the 'user' visitor to the navigation block and also the setting block.

Lastly since these blocks are already 'deactivated' and cannot be seen on the front page, I clicked on 'settings>front page settings>edit settings' and ticked the 'include topic section' this is where I created the 'forum' I needed. The 'Visitor' can also access the courses through moodle's 'guest' access and prompt them for a 'guest' password. Since I also included 'list of courses' in the 'front page items when logged in'

Again thank you Marty, couldn't have done it without your help.

Regards,

Sterling Uy