I would like to know if it is posible to create a role that can admin everything in a category but can´t admin other categorys.
For example: I have a moodle instalation for educational centers, every category in moodle referers to a center and in in every center we have some courses. So, we want to create a rol with capabilities to administrate users for one center but we do not want that role to change other centers users. In the same way, the role has to be able to administrate blocks, themes... in fact the same capabilities as the global admin but only for one center and without capabilities to change any other centers.
I have been looking for a solution using all kind of roles capabilities and roles contexts conbinations, and it seems to be allmost imposible. It would help me so much if someone has any idea on how to create that rol or confirm that it is not posible and explain me which could be the way to get that, developing some code.
Thank you very much!!!
i tried to think it over... and here are my thoughts.
1. It's possible to create admin role to some category and he will be able to assign roles, do everything with courses within the cathegory. But actually he won't be able to create users.
2. if i'm not mistaken only user with the global admin role can create users. But there is an opportunity for the users to register themselves, and then admin in the category can assign roles to them.
i hope it'll help you somehow
I can create a user with an admin role in the category context, but I have two problems:
1- When a user logs in, automatically is given the role of authenticated user, and it looks like this role overrides the admin role given in the category context. Of course I could change the permissions for the authenticated user, but that means to change permissions for every authenticated users, even students given them too much permissions.
2- Your solution was really good, register the users themselves and then just assign roles, but that was already done when registering users from ldap (it is the way we register students the first time). What I need is to have an extra way to create users, controlled by an admin for each category(each category is a different school). The problem is that every category should have and administrator for creating thous users but only for the courses within the category, the others categories users should not be visibles for that admin. It seems that it is not possible to have the users sorted by categories and filter the users automaticaly, so every school administrator can only administrate her own category/school users. any ideas hove to solve it?
Sorry if I am asking such a strange thing... I know it is difficult to understand and maybe is a little bit complex but I try to do me best to explain the problem even it is a little bit messy ;)
Any way, thank you very much for your answer.
Yesterday i made some changes in my first message and actually these changes were not saved I really hope that today everything will be ok)
You can duplicate an admin role on the main page and change permissions there (or create a new role) for your category admins and they will be able to create users and register them to courses. You should give him some rights to do smth on the main page. When a user is admin only in the category, i think he is not able to create users.
And how to filter users automatically? i guess it is impossible, u need to make some changes in the code, but i don't understand not much in that question, so...
I have been looking for a solution and definitively you are right on both things.
1- It is not possible to create users in a category context role (This is confusing, because when you define the permissions, the "create users" option is configurable but actually, this option is not aplicable in a category context. ). So I made what you recommended me: create a new role with permissions for create users and give it to the category admin in the system context.
2- Automatically filtering of users by category is neither possible, like you explain me correctly in your last message. So I have started to change the code to filter the users for every category admin. ( I use "user profile fields" to make a relationship between users and categories. I don´t like too much to modify the code, for mantaining the stability, but it seems there is not other way and is working right for me +-.)
Thank you very much for all your support!!