Create custom roles in chamilo

Please always state the Chamilo version you are referring to when reporting issues or asking questions.

Moderator: Coursenligne

Create custom roles in chamilo

Postby DamienRLyon » 29 Jun 2017, 10:57

Hello

How i can Create custom roles in chamilo ?

Example : Super teacher (create course and manage users in the same profil)

Damien
Damien Renou
Membre de l'association Chamilo (France)
Chamilo Camp le 25 juillet 2017 a Lyon
https://www.ludiscape.com/actualites-et-evenements/chamilo-camp-2017.php
User avatar
DamienRLyon
New user
 
Posts: 12
Joined: 20 May 2015, 05:26
Location: Lyon

Re: Create custom roles in chamilo

Postby DamienRLyon » 29 Jun 2017, 12:59

I have find !

I have modified function api_is_allowed_to_create_course

function api_is_allowed_to_create_course()
{
if (api_is_platform_admin()) {
return true;
}

// Teachers can only create courses
if (api_is_teacher()) {
if (api_get_setting('allow_users_to_create_courses') === 'true') {
return true;
} else {
return false;
}
}

// SESSION_COURSE_COACH can create courses
$roles = api_detect_user_roles($user_id, $courseId, $session_id);
if (in_array(SESSION_COURSE_COACH, $roles)) {
return true;
}

return Session::read('is_allowedCreateCourse');
}
Damien Renou
Membre de l'association Chamilo (France)
Chamilo Camp le 25 juillet 2017 a Lyon
https://www.ludiscape.com/actualites-et-evenements/chamilo-camp-2017.php
User avatar
DamienRLyon
New user
 
Posts: 12
Joined: 20 May 2015, 05:26
Location: Lyon


Return to All topics, all versions

Who is online

Users browsing this forum: No registered users and 2 guests