Opigno LMS API in Opigno LMS 7
Opigno LMS provides an API that modules can use when inside the Opigno distribution context. These functions are meant to simplify the life of end users by allowing modules to set sensible defaults when installed. This is especially useful for apps and permissions. Many less-technical users will expect apps/modules to work out of the box. They will not expect to have to dig through long permission lists to check boxes for specific roles.
When a new app/module is coded, developers should think about the different permissions and to which kind of users they would -- in most cases -- apply. Opigno ships with default OG roles, which are available as constants. Modules that provide other group bundles are encouraged to expose similar constants so that the same API can be used for similar purposes.
The available role constants Opigno LMS provides apply to the course bundle:
- OPIGNO_LMS_COURSE_STUDENT_ROLE
- OPIGNO_LMS_COURSE_TEACHER_ROLE
- OPIGNO_LMS_COURSE_COACH_ROLE
- OPIGNO_LMS_COURSE_ADMIN_ROLE
The available role constants Opigno LMS provides for the platform:
File
- ./
opigno_lms.profile, line 444 - Enables modules and site configuration for a standard site installation. Provides a default API for Apps and modules to use. This will simplify the user experience.
Functions
Name | Location | Description |
---|---|---|
opigno_lms_get_og_role_id |
./ |
Get the default OG role ids. |
opigno_lms_get_platform_role_id |
./ |
Get the default platform role ids. |
opigno_lms_get_role_id Deprecated |
./ |
Get the default OG role ids. |
opigno_lms_set_og_permissions |
./ |
Set OG permissions for a specific bundle and specific roles. This function is globally available and modules and apps should use it to set default permissions, simplifying module installation and site management. |
opigno_lms_set_platform_permissions |
./ |
Set platform permissions for specific roles. This function is globally available and modules and apps should use it to set default permissions, simplifying module installation and site management. |