Commit 233aa245 authored by Leif Andersson's avatar Leif Andersson
Browse files

Bara synlig för medlemmar i "UseReglerAddress"

parent 3d6ae0c8
......@@ -19,7 +19,7 @@
* @since 1.0
* @version 2015-09-02
* @modifiedby $LastChangedBy: LA $
* @lastmodified $Date: 2015-09-02$
* @lastmodified $Date: 2021-05-28$
* @license GPL
**/
class ReglerAddress extends CMSModule
......@@ -43,7 +43,7 @@ class ReglerAddress extends CMSModule
* GetVersion()
* @return string version number (can be something like 1.4rc1)
*/
function GetVersion() { return '2015-09-02'; }
function GetVersion() { return '2021-05-28'; }
/**
* GetHelp()
......@@ -115,9 +115,18 @@ class ReglerAddress extends CMSModule
/**
* VisibleToAdminUser()
* If your module does have an Admin Panel, you
* can control whether or not it's displayed by the boolean
* that is returned by this method. This is primarily used
* to hide modules from admins who lack permission to use
* them.
* In this case, the module will only be visible to admins
* who have "Use ReglerAddress" permissions.
* @return bool True if this module is shown to current user
*/
function VisibleToAdminUser() { return True; }
function VisibleToAdminUser() {
return $this->CheckPermission('Use ReglerAddress');
}
/**
* GetDependencies()
......
......@@ -15,6 +15,12 @@
if( !defined('CMS_VERSION') ) exit;
//echo '<pre>'; print_r($params); echo '</pre>';
if (! $this->CheckPermission('Use ReglerAddress')) {
return $this->DisplayErrorPage($id, $params, $returnid,
'ReglerAddress Access denied');
}
$canChangeRecord = $this->CheckPermission('Use ReglerAddress');
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment