Jump to content

Set employee access to only allow editing of the 'Homepage editorial' module


Recommended Posts

I'm trying to set the module permissions so that a specific employee group is only allowed to edit/use the module 'Home Text Editor'.

 

I've enabled 'view' and 'configure' for only 1 module, the 'Home text editor' module. Though all other modules still show up in the modules list. Even the not-installed modules.

 

Any idea how I can achieve this goal ?

 

Other solution could be to setup a CMS homepage, though that would trigger more problems, since then the other homepage funtionality (featured products etc) is lost.

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

I'm digging on the same issue. would be interessted in a solution for that problem!

 

I did a bit a hack to solve part of this problem:

-> added a special css in shop/admin**/header.inc.php, when emplyee with certain ID is logged in.

...

if ($employee->id_profile == 4) { // employee vendor
echo '<link type="text/css" rel="stylesheet" href="'._PS_CSS_DIR_.'admin_vendor.css" />';
}

...

If so, I hide all odthers modules than the 'Homepage editorial' with CSS.

 

it's a bit a hack, but it works..

Edited by maki (see edit history)
  • Like 1
Link to comment
Share on other sites

Thx for the tip, also used a similar fix it like this, though it's not an ideal solution.

 

I edited /admin/themes/default/header.tpl around line 100 (after loading the .js files) like so:


{if $employee->id_profile != 1 && $controller_name == 'adminmodules'} {*// 1 = superadmin*}
<script type="text/javascript">
$(document).ready(function() {
$('.sidebar').hide();
$('#moduleContainer').css('margin-left',0);
$('#list-action-button > *').hide();
$('#anchorEditorial').find('.desactive-module').hide();
$('#anchorEditorial').find('.delete-module').hide();
$('#anchorEditorial').parent().parent().addClass('donthide');
$('div#moduleContainer > table > tbody > tr').hide();
$('#desc-module-new').hide();
$('div#moduleContainer > div').hide();
$('.donthide').show();
$('input[name=modules]');
$('input[name=modules][type=checkbox]').hide();
$('input[id=checkme][type=checkbox]').hide();
});
</script>
{/if}

 

Better solution would obviously be to not render the elements instead of hiding them suing jquery.

 

I did try using pure css, but since there's no parent selector (yet) in css, I didn't succeed.

 

@maaki: can you post the css you used pls ?

Edited by Tito (see edit history)
Link to comment
Share on other sites

Here's the CSS:

/* CSS Admin Vendor PrestaShop */

/* show only certrain modules */
#content .header_module {
   display: none;
}
#content #front_office_features {
   display: block;
}
#content #front_office_features_content div {
   display: none;
}
#content #front_office_features_content div#modgo_editorial {
   display: block;
}
#content #front_office_features_content div#modgo_editorial .action_module_delete,
#content #front_office_features_content div#modgo_editorial .button.small{
   display: none;
}

  • Like 1
Link to comment
Share on other sites

Here's the CSS:

/* CSS Admin Vendor PrestaShop */

/* show only certrain modules */
#content .header_module {
display: none;
}
#content #front_office_features {
display: block;
}
#content #front_office_features_content div {
display: none;
}
#content #front_office_features_content div#modgo_editorial {
display: block;
}
#content #front_office_features_content div#modgo_editorial .action_module_delete,
#content #front_office_features_content div#modgo_editorial .button.small{
display: none;
}

 

Thx!

Link to comment
Share on other sites

×
×
  • Create New...