Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ public function init()
*
* @param string $gperm_name name of the permission to test
* @param int $gperm_itemid id of the object to check
* @param bool $trueifadmin true to always return true for admin groups
*
* @return bool true if user has access, false if not
**/
public function checkPermission($gperm_name, $gperm_itemid)
public function checkPermission($gperm_name, $gperm_itemid, $trueifadmin = true)
{
$gperm_itemid = (int) $gperm_itemid;
$gperm_groupid = $this->getUserGroups();
Expand All @@ -71,7 +72,8 @@ public function checkPermission($gperm_name, $gperm_itemid)
$gperm_name,
$gperm_itemid,
$gperm_groupid,
$this->mid
$this->mid,
(bool) $trueifadmin
);
}

Expand All @@ -83,6 +85,7 @@ public function checkPermission($gperm_name, $gperm_itemid)
* @param string $url module relative url to redirect to
* @param int $time time in seconds to delay
* @param string $message message to display with redirect
* @param bool $trueifadmin true to always return true for admin groups
*
* @return void
**/
Expand All @@ -91,15 +94,17 @@ public function checkPermissionRedirect(
$gperm_itemid,
$url,
$time = 3,
$message = ''
$message = '',
$trueifadmin = true
) {
$gperm_itemid = (int) $gperm_itemid;
$gperm_groupid = $this->getUserGroups();
$permission = $this->permissionHandler->checkRight(
$gperm_name,
$gperm_itemid,
$gperm_groupid,
$this->mid
$this->mid,
(bool) $trueifadmin
);
if (!$permission) {
$helper = Helper::getHelper($this->dirname);
Expand Down