You are here

public function filedepot_permission_object::setTruePermissions in filedepot 7

Set the permissions ONLY if the value is 1 (set), otherwise nothing happens

Parameters

type $view If 1, will be set to true :

type $upload If 1, will be set to true :

type $upload_direct If 1, will be set to true :

type $upload_ver If 1, will be set to true :

type $approval If 1, will be set to true :

type $admin If 1, will be set to true :

File

./permissions.class.php, line 100
permissions.class.php Permissions management class for the Filedepot module

Class

filedepot_permission_object
Holds information about a CIDs permissions

Code

public function setTruePermissions($view, $upload, $upload_direct, $upload_ver, $approval, $admin) {
  if ($view == 1) {
    $this->_PermissionArray['view'] = TRUE;
  }
  if ($upload == 1) {
    $this->_PermissionArray['upload'] = TRUE;
  }
  if ($upload_direct == 1) {
    $this->_PermissionArray['upload_direct'] = TRUE;
  }
  if ($upload_ver == 1) {
    $this->_PermissionArray['upload_ver'] = TRUE;
  }
  if ($approval == 1) {
    $this->_PermissionArray['approval'] = TRUE;
  }
  if ($admin == 1) {
    $this->_PermissionArray['admin'] = TRUE;
  }
}