Skip to content

Commit

Permalink
PDFテンプレートモジュールにモジュール無効化やプロファイル設定で制限をかけてもアクセスができる不具合の修正
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryon1211 committed Mar 7, 2024
1 parent deb47c1 commit a7911d8
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 40 deletions.
6 changes: 5 additions & 1 deletion include/utils/UserInfoUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,11 @@ function isPermitted($module,$actionname,$record_id='')
$permission = "yes";
}
}else {
$permission = "no";
if($module === 'PDFTemplates' && $profileTabsPermission[$tabid] === 0) {
$permission = "yes";
}else {
$permission = "no";
}
}

$log->debug("Exiting isPermitted method ...");
Expand Down
17 changes: 7 additions & 10 deletions modules/PDFTemplates/views/Detail.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@

class PDFTemplates_Detail_View extends Vtiger_Index_View {

public function requiresPermission(\Vtiger_Request $request) {
return array();
}

public function checkPermission($request) {
public function checkPermission($request) {
$moduleName = $request->getModule();
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
if(!$moduleModel->isActive()){
return false;
}
return true;
if($moduleModel->isActive()) {
return parent::checkPermission($request);
}

throw new AppException(vtranslate('LBL_PERMISSION_DENIED'));
}

function preProcess(Vtiger_Request $request, $display=true) {
parent::preProcess($request, false);

Expand Down
17 changes: 7 additions & 10 deletions modules/PDFTemplates/views/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,16 @@

Class PDFTemplates_Edit_View extends Vtiger_Index_View {

public function requiresPermission(\Vtiger_Request $request) {
return array();
}

public function checkPermission($request) {
public function checkPermission($request) {
$moduleName = $request->getModule();
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
if(!$moduleModel->isActive()){
return false;
}
return true;
if($moduleModel->isActive()) {
return parent::checkPermission($request);
}

throw new AppException(vtranslate('LBL_PERMISSION_DENIED'));
}

public function preProcess(Vtiger_Request $request, $display = true) {
$record = $request->get('record');
if (!empty($record)) {
Expand Down
17 changes: 7 additions & 10 deletions modules/PDFTemplates/views/List.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,16 @@ function __construct() {
parent::__construct();
}

public function requiresPermission(\Vtiger_Request $request) {
return array();
}

public function checkPermission($request) {
public function checkPermission($request) {
$moduleName = $request->getModule();
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
if(!$moduleModel->isActive()){
return false;
}
return true;
if($moduleModel->isActive()) {
return parent::checkPermission($request);
}

throw new AppException(vtranslate('LBL_PERMISSION_DENIED'));
}

function preProcess(Vtiger_Request $request, $display = true) {
parent::preProcess($request, false);

Expand Down
16 changes: 7 additions & 9 deletions modules/PDFTemplates/views/Popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@

class PDFTemplates_Popup_View extends Vtiger_Popup_View {

public function requiresPermission(\Vtiger_Request $request) {
return array();
}

public function checkPermission($request) {
public function checkPermission($request) {
$moduleName = $request->getModule();
$moduleModel = Vtiger_Module_Model::getInstance($moduleName);
if(!$moduleModel->isActive()){
return false;
}
return true;
if($moduleModel->isActive()) {
return parent::checkPermission($request);
}

throw new AppException(vtranslate('LBL_PERMISSION_DENIED'));
}

/*
* Function to initialize the required data in smarty to display the List View Contents
*/
Expand Down

0 comments on commit a7911d8

Please sign in to comment.