CMS  Version 3.9
PermissionsCheckHelper Class Reference

Public Member Functions

 __construct ($subject)
 
 checkPermissions ($content)
 
 onStartRow ($content)
 
 formatAccess ($content)
 

Public Attributes

 $subject
 

Detailed Description

Definition at line 9 of file permission_check_helper.inc.

Constructor & Destructor Documentation

◆ __construct()

PermissionsCheckHelper::__construct (   $subject)

Definition at line 13 of file permission_check_helper.inc.

14  {
15  $this->subject = $subject;
16  }
$email subject

Member Function Documentation

◆ checkPermissions()

PermissionsCheckHelper::checkPermissions (   $content)

Definition at line 18 of file permission_check_helper.inc.

19  {
20  $section = $content->Section();
21  $permissions = $section->getPermissions($content);
22  if ($permissions)
23  {
25  {
26  return false;
27  }
28  }
29  else if (!checkRole($section->getRole($content), $this->subject))
30  {
31  return false;
32  }
33 
34  return true;
35  }
$section
Definition: event_form.inc:44
static checkPermissions($permissions, $account=null)
Check all the permissions specified in the given string.
Definition: settings.inc:270
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content
Definition: styles.css.inc:24

◆ formatAccess()

PermissionsCheckHelper::formatAccess (   $content)

Definition at line 44 of file permission_check_helper.inc.

45  {
46  $canAccess = $this->checkPermissions($content);
47 
48  return $canAccess ? "<img src='/fakoli/images/on.png' alt='Yes'/>" : "<img src='/fakoli/images/off.png' alt='No'/>";
49  }

◆ onStartRow()

PermissionsCheckHelper::onStartRow (   $content)

Definition at line 37 of file permission_check_helper.inc.

38  {
39  $canAccess = $this->checkPermissions($content);
40 
41  return $canAccess ? "yay" : "nay";
42  }

Member Data Documentation

◆ $subject

PermissionsCheckHelper::$subject

Definition at line 11 of file permission_check_helper.inc.


The documentation for this class was generated from the following file: