I can't disable export of grid reports.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • partomas
    Active Community Member
    • Sep 2018
    • 331

    I can't disable export of grid reports.

    At /#Admin/settings there are such option "Disable Export (only admin is allowed)" As I understood, it disable EXPORT function in all CRM as general setting. I gave no idea is it a bug or the feature by design, but in some reports user can't export report, but in another one thay van. Who can explain how this feature are working and what should I do to disable export of data in all reports.

    First idea - I can't disable export of grid reports.
  • item
    Active Community Member
    • Mar 2017
    • 1476

    #2
    export disable for listView.
    If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

    Comment

    • Vadym
      Super Moderator
      • Jun 2021
      • 345

      #3
      Hi partomas,

      I have tested a scenario identical to yours, everything works as expected. When "Disable Export (only admin is allowed)" = true, then the records export feature is not available for the "Regular" type users.
      Try to disable "Export Permission" via ACL Roles:
      https://docs.espocrm.com/user-guide/...access-control

      Comment

      • Laimonas
        Senior Member
        • May 2021
        • 197

        #4
        Hi there,

        I have also tested export with Grid Reports, but everything works not as expected... My configuration is: Report = Grid, User type = regular, Disable Export (only admin is allowed) = true, Roles -> Export Permission = no.

        It looks like all export permissions are unavailable, however, a user still can export Grid Reports. Please find a screenshot of my configuration attached.

        Any ideas of how to disable the export of the Grid Report?
        Attached Files

        Comment


        • Vadym
          Vadym commented
          Editing a comment
          Hi partomas,

          Since your user is a member of the teams, try to check the summed user permissions (Administration -> Users -> Access).
      • item
        Active Community Member
        • Mar 2017
        • 1476

        #5
        application/Espo/Modules/Advanced/Services/Report.php
        search word "export"..

        put this

        $roles = $this->getUser()->getRoles();

        $GLOBALS['log']->warning(json_encode($roles));

        try a export with the user.

        send here on forum the result from data/logs

        As i see, out-of-box, acl check :

        if (!$this->getAcl()->check($report, 'read')) {
        throw new Forbidden();
        }
        If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

        Comment

        • Laimonas
          Senior Member
          • May 2021
          • 197

          #6
          Hmm... I was looking for a solution in the UI, but let's try it your way I am not sure if I put it in the right place since Data logs are not very explicit. I have made the export twice (please find attachments)
          Attached Files

          Comment

          • item
            Active Community Member
            • Mar 2017
            • 1476

            #7
            Yes it's right place..


            but this work, same place : so only admin can export.. 2 solutions under.. it's not upgrade safe.


            $userRoleList = $this->entityManager
            ->getRepository('User')
            ->getRelation($this->user, 'roles')
            ->find();

            foreach($userRoleList as $role)
            {
            $GLOBALS['log']->warning( $role->get('exportPermission') );
            if ($role->get('exportPermission') == 'not-set') // or 'no'
            {
            throw new Forbidden();
            }
            }
            if ($this->getUser()->isRegular())
            {
            throw new Forbidden();
            }

            for upgrade safe, you can extend to custom folder. only the export function (certainly work i think)
            If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

            Comment

            • item
              Active Community Member
              • Mar 2017
              • 1476

              #8
              Thank you .. maybe it's a feature request or bug..
              If you could give the project a star on GitHub. EspoCrm believe our work truly deserves more recognition. Thanks.​

              Comment

              • Laimonas
                Senior Member
                • May 2021
                • 197

                #9
                yuri Maybe you will give us the answer:

                If a user is not granted permission to export reports, why a user can still export the Grid report?

                Meanwhile, if a user tries to export the List report he gets an "Error 403: Access Denied..." message. We could not find how to solve this issue in the GUI. I am not a true developer, thus it is not such as easy task for me to make decent changes inside the code...

                Is it a bug or I am doing something wrong?
                Attached Files

                Comment

                • rabii
                  Active Community Member
                  • Jun 2016
                  • 1250

                  #10
                  I had similar situation and Yuri said that it will be applied to list report on next advanced pack version. Not sure if it will be applied to Grid report as well.
                  Rabii
                  Web Dev

                  Comment

                  Working...