dokeos
[ class tree: dokeos ] [ index: dokeos ] [ all elements ]

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:

author:  

Patrick Cool <patrick.cool@ugent.be>, Ghent University

A list of all the functions (in no particular order) ---------------------------------------------------- store_permissions($content,$id) get_permissions($content,$id) limited_or_full($current_permissions)

filesource:  Source Code for this file








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:

author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University


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  
[ Top ]



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:

author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University
version:  1.0


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  
[ Top ]



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:

author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University
version:  1.0


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  
[ Top ]



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:

author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University
version:  1.0


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  
[ Top ]



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:

author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University
version:  1.0


Parameters

   $current_course_roles  
   $current_platform_roles  
[ Top ]



get_all_roles [line 521]

array get_all_roles( [ $content = 'course'])

This function gets all the current roles of the user or group



Tags:

return:  that contains the name of the roles the user has
author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University
version:  1.0


Parameters

   $content  
[ Top ]



get_permissions [line 129]

void get_permissions( $content $content, $id $id)

This function retrieves the existing permissions of a user, group or role.



Tags:

author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University
version:  1.0


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
[ Top ]



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:

return:  that contains the name of the roles the user has
author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University
version:  1.0
todo:  consider having a separate table that contains only an id and a name of the role.


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  
[ Top ]



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:

return:  that contains the name of the roles the user has
author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University
version:  1.0
todo:  consider having a separate table that contains only an id and a name of the role.


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'
[ Top ]



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:

author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University
version:  1.0
todo:  currently there is a setting user_permissions and group_permissions. We should merge this in one config setting.


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)
[ Top ]



my_print_r [line 671]

void my_print_r( $array)



Parameters

   $array  
[ Top ]



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

   $array1  
   $array2  
[ Top ]



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:

author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University
version:  1.0


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
[ Top ]



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:

author:  Patrick Cool <patrick.cool@ugent.be>, Ghent University
version:  1.0


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
[ Top ]



Documentation generated on Thu, 12 Jun 2008 14:12:01 -0500 by phpDocumentor 1.4.1