Author Topic: Template Group Permissions not used!  (Read 2081 times)

andy.hoyle

  • Newbie
  • *
  • Posts: 30
    • View Profile
Template Group Permissions not used!
« on: July 24, 2009, 05:57:42 am »
Template Management permissions don't take into account group permissions - only user based permissions:

Changed apllication/Controllers/TemplateController.php

changed lines below to fix problem

Code: [Select]
<?php

class TemplateController extends ApplicationController {

        function 
__construct() {
                
parent::__construct();
                
prepare_company_website_controller($this'website');
                
ajx_set_panel("administration");

                
// Access permissios
                
if(!logged_user()->isCompanyAdmin(owner_company())) {
                        
flash_error(lang('no access permissions'));
                        
ajx_current("empty");
                } 
// if
        
}

        function 
index() {
--                if (!
can_manage_templates(logged_user())) {
++                if (!
can_manage_templates(logged_user(),true)) {
                        
flash_error(lang("no access permissions"));
                        
ajx_current("empty");
                        return;
                }
                
tpl_assign('templates'COTemplates::findAll());
        }

        function 
add() {
--                if (!
logged_user()->getCanManageTemplates()) {
++                if(!
can_manage_templates(logged_user(),true)){

ignacio

  • Hero Member
  • *****
  • Posts: 1703
    • View Profile
Re: Template Group Permissions not used!
« Reply #1 on: July 24, 2009, 10:33:57 am »
Thanks Andy,

The second parameter for 'can_manage_templates' is not necessary because it is true by default. Fixed the check for the 'add' function and added it to other functions.