CMS
Version 3.9
permission_check_helper.inc
Go to the documentation of this file.
1
<?php
7
Fakoli::using
(
"developer_tools"
);
8
9
class
PermissionsCheckHelper
10
{
11
var
$subject
;
12
13
function
__construct
(
$subject
)
14
{
15
$this->
subject
=
$subject
;
16
}
17
18
function
checkPermissions
(
$content
)
19
{
20
$section
=
$content
->Section();
21
$permissions
=
$section
->getPermissions(
$content
);
22
if
(
$permissions
)
23
{
24
if
(!
Settings::checkPermissions
(
$permissions
, $this->
subject
))
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
44
function
formatAccess
(
$content
)
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
$section
Definition:
event_form.inc:44
Fakoli\using
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition:
core.inc:116
PermissionsCheckHelper
Definition:
permission_check_helper.inc:10
PermissionsCheckHelper\$subject
$subject
Definition:
permission_check_helper.inc:11
PermissionsCheckHelper\checkPermissions
checkPermissions($content)
Definition:
permission_check_helper.inc:18
PermissionsCheckHelper\__construct
__construct($subject)
Definition:
permission_check_helper.inc:13
PermissionsCheckHelper\onStartRow
onStartRow($content)
Definition:
permission_check_helper.inc:37
PermissionsCheckHelper\formatAccess
formatAccess($content)
Definition:
permission_check_helper.inc:44
Settings\checkPermissions
static checkPermissions($permissions, $account=null)
Check all the permissions specified in the given string.
Definition:
settings.inc:270
$permissions
$permissions
Definition:
permissions_checker.inc:37
$content
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content
Definition:
styles.css.inc:24
subject
$email subject
Definition:
test_email_form.inc:41
code
cms.sonjara.com
cms
components
developer_tools
permission_check_helper.inc
Generated on Tue Mar 23 2021 15:36:12 for CMS by
1.9.1