[Mapbender-users] Mapbender and Datatables

Thorsten Hack (WhereGroup) thorsten.hack at wheregroup.com
Thu Aug 24 01:42:28 PDT 2023


Hello Gál,

I'm assuming you want to protect access to the websites providing these 
tables and not the tables in your (Postgres) database.

You have a several options. The quickest solution would be to setup HTTP 
Basic Authentication for the directory you serve the datatables from. A 
tutorial can be found for example here: 
https://www.digitalocean.com/community/tutorials/how-to-set-up-password-authentication-with-apache-on-ubuntu-14-04
You can use the same password you use for your mapbender login but it 
wont't change automatically when you change your mapbender password.

You can also integrate your pages in the mapbender symfony application. 
Then you can fully use the mapbender authentication system. For this to 
work, you'd need to create your own Bundle, an overview on how to do 
this can be found here: 
https://github.com/mapbender/mapbender-starter/blob/master/CONTRIBUTING.md#bundles.

Within your bundle, add a controller and set it up similar to this:

namespace Your\Bundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class YourController extends AbstractController

     /**
      * @Route("/some/route, methods={"GET", "POST"})
      */
     public function someAction(Request $request): Response
     {
         if ($this->getUser() === null) {
             throw $this->createAccessDeniedException();
         }

         // serve your datatables here

     }

}

I hope that helps, good luck! If you need professional support, you can 
always contact the WhereGroup.

Best,

Thorsten Hack


-- 
**********************************
Aufwind durch Wissen!
Web-Seminare und Online-Schulungen
bei der www.foss-academy.com/
**********************************

WhereGroup GmbH
Schwimmbadstr. 2
79100 Freiburg
Germany

Tel.: +49 (0)761 / 519 102 - 67
Fax: +49 (0)761 / 519 102 - 11

thorsten.hack at wheregroup.com
www.wheregroup.com
Geschäftsführer:
Olaf Knopp, Peter Stamm
Amtsgericht Bonn, HRB 9885


Am 24.08.23 um 09:28 schrieb Gal Zsolt:
> Hello List!
>
> In Mapbender application I use other tables which I edit using 
> Datatables genereted forms.
> Can I and how to protect these tables with the username and password I 
> use for Mapbender Login?
> (I think if I put the Datatables directories somewhere in Mapbender 
> directories it will work?)
>
> Thank's in advance for any help/answer.
>
> GÁL Zsolt
>
>
>
> _______________________________________________
> Mapbender_users mailing list
> Mapbender_users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapbender_users



More information about the Mapbender_users mailing list