0

I am creating a module for a simple form submission. In admin, I am showing a table view of all entries. I have a specific member group "pitch" who can access only that module. In addition they can't access the "Export in CSV" functionality for listing. But super admin can do all things.

  1. How can I create a custom privilege for "pitch" member group so that they can't access "Export" button.
  2. OR hide button if "pitch" member login in CP
  3. How can we do this through module?
  4. Please provide a reference url or a piece of code.
4
  • Umm.. Your question is pretty unclear. "access" really doesn't make sense... Are you actually referring to member group privileges? Please clean up your question and grammar and we'll be glad to help.
    – jrothafer
    Aug 10, 2015 at 12:09
  • Here's your first reference URL: expressionengine.stackexchange.com/help/how-to-ask
    – jrothafer
    Aug 10, 2015 at 12:11
  • I'd love to try and help you! Please edit your question and be more verbose in what you've done (do you already have a custom module in place?) and examples of what your looking to accomplish.
    – jrothafer
    Aug 10, 2015 at 12:15
  • So this is Control Panel related? Avinash, please edit your question, don't add comments to it.
    – jrothafer
    Aug 10, 2015 at 12:29

1 Answer 1

0

You could use the add on CP CSS & JS to hide the button with CSS as you already suggest yourself. I know there are options to check for member privileges in add-ons but I don't know them off the top of my head.

Edit:

You could use this code in your module. More info:

if (ee()->session->userdata('group_id') == 1)
{
    exit('A Superadmin');
}
2
  • Hi Balloonatic, we can't use group id as Its a static id. we need to check privilege like 'can_export_data' or 'can_edit' like this. so that we can use it in general. Is it possible in expression engine to give such privilege to group member during creating new one and check it in our template?
    – Avinash
    Aug 10, 2015 at 14:08
  • In EE you can give members access to modules, but not to specific module functions as far as I know. That is something you would have to code yourself. I would make a view where all member groups are shown and an option to register which privilege each group has. Aug 11, 2015 at 6:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.