Hi,
Thanks a lot Stefan and Andrea for your replies.
Now the solution of Stefan works perfectly in WMS and WFS requests (each 
Geoserver user can view/update his own features only). The problem now is with 
my custom WPS, I've many custom WPS functions that connect directly to the DB 
(not through a Data Store), so there will be no Data Store Session 
startup/closeup SQL. In this case how can I set the Postgres session variable 
with the current Geoserver user?

Regards,
Nanaso

Sent with [ProtonMail](https://protonmail.com) Secure Email.

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Wednesday, October 31, 2018 4:31 PM, Andrea Aime 
<andrea.a...@geo-solutions.it> wrote:

> On Mon, Oct 29, 2018 at 12:45 PM Nanaso via Geoserver-users 
> <geoserver-users@lists.sourceforge.net> wrote:
>
>> Hi,
>> Thanks a lot Nuno for your reply.
>> There are two issues:
>> 1- The Geofence extention can satisfy my needs in the following way: I have 
>> an attribute in my layer called "user_name", I can check if the logged in 
>> username equals to this attribute, then I will allow the logged in user to 
>> access this feature, and vise versa.
>> The problem is how to get the current logged in username. Is there an 
>> environment varaible that holds the current logged in user?
>
> You can use the GSUSER environment variable, to be extracted caling 
> env('GSUSER') in a CQL filter
>
>> 2- The other issue is regarding installation of Geofence. I've tried to 
>> install version 13 of Geofence extention in a Geoserver of version 13, it 
>> works fine, but the place where I should enter the CQL filter is not exist. 
>> According to the documentation:
>> https://docs.geoserver.org/stable/en/user/community/geofence-server/gui.html#rule-page
>
> I can't remember which version it got in, but those filters can only be 
> placed in a LIMIT type rule, not in a ACCEPT or DENY one.
>
>> There should be a place to specify the CQL fitler for read and write. But it 
>> looks like this part of the configuration doesn't exist in version 13 of 
>> Geofence.
>> I've then tried to install verison 14 of Geofence in a veriosn 14 of 
>> Geoserver, but the server failed to launch with many exceptions. My machine 
>> is Mac OS High Sierra. And here you're the exceptions I recieve when 
>> launching geoserver after adding Geofence to it:
>>
>> 29 Oct 14:31:44 WARN [geoserver.config] - Error reading resource 
>> ServletContext resource [/${geofence-ovr}]
>> java.io.FileNotFoundException: ServletContext resource [/${geofence-ovr}] 
>> cannot be resolved to absolute file path - web application archive not 
>> expanded?
>
> Unsure about this one, Alessio (cc'ed) do you know?
>
>> org.springframework.beans.factory.CannotLoadBeanClassException: Error 
>> loading class [org.geoserver.monitor.hib.HibernateMonitorDAO2] for bean with 
>> name 'hibMonitorDAO' defined in URL 
>> [jar:file:/Volumes/MyData/projects/GIS/the_proj/temp/geoserver-2.14.0/webapps/geoserver/WEB-INF/lib/gs-monitor-hibernate-2.14-SNAPSHOT.jar!/applicationContext-hib2.xml]:
>>  problem with class file or dependent class; nested exception is 
>> java.lang.NoClassDefFoundError: org/geoserver/monitor/MonitorDAO
>
> The hibernate monitoring was dropped down to community status due to lack of 
> maintainer in 2.14.x, and has been removed from the
> build completely in 2.15.x (the module broke due to other updates, with no 
> maintainer the was no other choice but to kill it).
> I'd advise against using it (or else, find someone that wants to maintain the 
> module and resurrect it, this would actually be even better ;-) )
>
> Cheers
> Andrea
>
> ==
>
> GeoServer Professional Services from the experts! Visit http://goo.gl/it488V 
> for more information. == Ing. Andrea Aime @geowolf Technical Lead 
> GeoSolutions S.A.S. Via di Montramito 3/A 55054 Massarosa (LU) phone: +39 
> 0584 962313 fax: +39 0584 1660272 mob: +39 339 8844549 
> http://www.geo-solutions.it http://twitter.com/geosolutions_it 
> ------------------------------------------------------- Con riferimento alla 
> normativa sul trattamento dei dati personali (Reg. UE 2016/679 - Regolamento 
> generale sulla protezione dei dati “GDPR”), si precisa che ogni circostanza 
> inerente alla presente email (il suo contenuto, gli eventuali allegati, etc.) 
> è un dato la cui conoscenza è riservata al/i solo/i destinatario/i indicati 
> dallo scrivente. Se il messaggio Le è giunto per errore, è tenuta/o a 
> cancellarlo, ogni altra operazione è illecita. Le sarei comunque grato se 
> potesse darmene notizia. This email is intended only for the person or entity 
> to which it is addressed and may contain information that is privileged, 
> confidential or otherwise protected from disclosure. We remind that - as 
> provided by European Regulation 2016/679 “GDPR” - copying, dissemination or 
> use of this e-mail or the information herein by anyone other than the 
> intended recipient is prohibited. If you have received this email by mistake, 
> please notify us immediately by telephone or e-mail.
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to