Procedural File: permissions_functions.inc.php
Source Location: /main/permissions/permissions_functions.inc.php
Page Details:
This files contains the common functions for the permissions
Tags:
assign_role [line 613]
void assign_role(
$content $content, $action $action, $id $id, $role_id $role_id, [ $scope = 'course'])
|
|
This function is called when we assign a role to a user or a group
Tags:
Parameters
| $content |
$content |
are we assigning a role to a group or a user |
| $action |
$action |
we can grant a role to a group or user or revoke it |
| $id |
$id |
the user_id of the user or the group_id of the group |
| $role_id |
$role_id |
the id of the role we are giving to a user or a group. |
| |
$scope |
|
display_checkbox_matrix [line 227]
void display_checkbox_matrix(
$permission_array $permission_array, $tool $tool, $permission $permission, [ $inherited_permissions = array()])
|
|
This function displays a checked or unchecked checkbox. The checkbox will be checked if the user, group or role has the permission for the given tool, unchecked if the user, group or role does not have the right
Tags:
Parameters
| $permission_array |
$permission_array |
the array that contains all the permissions of the user, group, role |
| $tool |
$tool |
the tool we want to check a permission for |
| $permission |
$permission |
the permission we want to check for |
| |
$inherited_permissions |
|
display_image_matrix [line 248]
void display_image_matrix(
$permission_array $permission_array, $tool $tool, $permission $permission, [ $inherited_permissions = array()], [ $course_admin = false], [ $editable = true])
|
|
This function displays a checked or unchecked image. The image will be checked if the user, group or role has the permission for the given tool, unchecked if the user, group or role does not have the right
Tags:
Parameters
| $permission_array |
$permission_array |
the array that contains all the permissions of the user, group, role |
| $tool |
$tool |
the tool we want to check a permission for |
| $permission |
$permission |
the permission we want to check for |
| |
$inherited_permissions |
|
| |
$course_admin |
|
| |
$editable |
|
display_image_matrix_for_blogs [line 331]
void display_image_matrix_for_blogs(
$permission_array $permission_array, $tool $user_id, $permission $tool, $permission, [ $inherited_permissions = array()], [ $course_admin = false], [ $editable = true])
|
|
Slightly modified: Toon Keppens This function displays a checked or unchecked image. The image will be checked if the user, group or role has the permission for the given tool, unchecked if the user, group or role does not have the right
Tags:
Parameters
| $permission_array |
$permission_array |
the array that contains all the permissions of the user, group, role |
| $tool |
$user_id |
the tool we want to check a permission for |
| $permission |
$tool |
the permission we want to check for |
| |
$permission |
|
| |
$inherited_permissions |
|
| |
$course_admin |
|
| |
$editable |
|
display_role_list [line 412]
void display_role_list(
$current_course_roles, $current_platform_roles)
|
|
This function displays a list off all the roles of the course (and those defined by the platform admin)
Tags:
Parameters
| |
$current_course_roles |
|
| |
$current_platform_roles |
|
get_all_roles [line 521]
array get_all_roles(
[ $content = 'course'])
|
|
This function gets all the current roles of the user or group
Tags:
Parameters
get_permissions [line 129]
void get_permissions(
$content $content, $id $id)
|
|
This function retrieves the existing permissions of a user, group or role.
Tags:
Parameters
| $content |
$content |
are we retrieving the rights of a user, a group or a role (the database depends on it) |
| $id |
$id |
the id of the user, group or role |
get_roles [line 489]
array get_roles(
$content $content, $id $id, [ $scope = 'course'])
|
|
This function gets all the current roles of the user or group
Tags:
Parameters
| $content |
$content |
are we finding the roles for a user or a group (the database depends on it) |
| $id |
$id |
the id of the user or group |
| |
$scope |
|
get_roles_permissions [line 554]
array get_roles_permissions(
$content $content, $id $id, [string $scope = 'course'])
|
|
This function gets all the roles that are defined
Tags:
Parameters
| $content |
$content |
are we finding the roles for a user or a group (the database depends on it) |
| $id |
$id |
the id of the user or group |
| string |
$scope |
Deprecated parameter allowing use of 'platform' scope - the corresponding tables don't exist anymore so the scope is always set to 'course' |
limited_or_full [line 182]
void limited_or_full(
$content $current_permissions, $id 1)
|
|
the array that contains the current permission a user, group or role has will now be changed depending on the Dokeos Config Setting for the permissions (limited [add, edit, delete] or full [view, add, edit, delete, move, visibility]
Tags:
Parameters
| $id |
1 |
the id of the user, group or role |
| $content |
$current_permissions |
are we retrieving the rights of a user, a group or a role (the database depends on it) |
my_print_r [line 671]
permission_array_merge [line 658]
void permission_array_merge(
$array1, $array2)
|
|
This function merges permission arrays. Each permission array has the following structure a permission array has a tool contanst as a key and an array as a value. This value array consists of all the permissions that are granted in that tool.
Parameters
store_one_permission [line 72]
void store_one_permission(
$content $content, $action $action, $id $id, $tool $tool, $permission $permission)
|
|
This function stores one permission in the correct table.
Tags:
Parameters
| $content |
$content |
are we storing rights for a user, a group or a role (the database depends on it) |
| $action |
$action |
are we granting or revoking a permission? |
| $id |
$id |
the id of the user, group or role |
| $tool |
$tool |
the tool |
| $permission |
$permission |
the permission the user, group or role has been granted or revoked |
store_permissions [line 24]
void store_permissions(
$content $content, $id $id)
|
|
This function stores the permissions in the correct table. Since Checkboxes are used we do not know which ones are unchecked. That's why we first delete them all (for the given user/group/role and afterwards we store the checked ones only.
Tags:
Parameters
| $content |
$content |
are we storing rights for a user, a group or a role (the database depends on it) |
| $id |
$id |
the id of the user, group or role |
|
|