CMS  Version 3.9
permission_check_helper.inc
Go to the documentation of this file.
1 <?php
7 Fakoli::using("developer_tools");
8 
10 {
11  var $subject;
12 
14  {
15  $this->subject = $subject;
16  }
17 
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  }
36 
37  function onStartRow($content)
38  {
39  $canAccess = $this->checkPermissions($content);
40 
41  return $canAccess ? "yay" : "nay";
42  }
43 
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  }
50 }?>
$section
Definition: event_form.inc:44
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
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
$email subject