[GeoNode-users] Force a new page in GeoNode is as public access

Simone Dalmasso simone.dalmasso at gmail.com
Wed May 6 11:47:50 PDT 2015


Hi Davi, I guess is because of the permission that you check
'base.change_resourcebase_metadata'. It's likely that the anonymous user
doesn't have that permission so the _resolve_layer redirects to the login.
If is a page to display metadata then why not check for view_resourcebase?

2015-05-06 20:39 GMT+02:00 Davi Custodio <davicustodio at gmail.com>:

> Hello list.
> I'm having trouble setting a new page I created in GeoNode becomes public
> access.
> I created a page to display the metadata of the layers, documents and
> maps. The page is accessible to authenticated users (with login), but
> anonymous users trying to access the page, are directed to the login page
> with the prefix /account/login/?Next=
>
> I checked the corresponding view of the page and it is without the
> @login_required.
>
> Below the view: (layers/views.py)
>
> *def layer_metadata_read (request, layerName, template = 'layers /
> layer_metadata_read.html'):*
> *    _resolve_layer layer = (*
> *        request,*
> *        layerName,*
> *        'Base.change_resourcebase_metadata'*
> *        _PERMISSION_MSG_METADATA)*
>
> *    return render_to_response (template, RequestContext (request, {*
> *        "Layer": layer,*
> *        'SITEURL': settings.SITEURL [: - 1]*
> *    }));*
>
> The file (layers/urls.py), the view metadata_read
>
> *urlpatterns = patterns (*
> *    'Geonode.layers.views'*
> *    url (r '^ $' TemplateView.as_view (template_name = 'layers /
> layer_list.html'), name = 'layer_browse'),*
> *    url (r '^ $ upload', 'layer_upload' name = 'layer_upload'),*
> *    url (r '^ (? P <layerName> [^ /] *) $', 'layer_detail' name =
> "layer_detail"),*
> *    url (r '^ (? P <layerName> [^ /] *) / $ metadata', 'layer_metadata'
> name = "layer_metadata")*
> *    url (r '^ (? P <layerName> [^ /] *) / remove $', 'layer_remove' name
> = "layer_remove")*
> *    url (r '^ (? P <layerName> [^ /] *) / replace $', 'layer_replace'
> name = "layer_replace"),*
> *    url (r '^ (? P <layerName> [^ /] *) / $ thumbnail', 'layer_thumbnail'
> name = 'layer_thumbnail'),*
> *    url (r '^ (? P <layerName> [^ /] *) / $ metadata_read',
> 'layer_metadata_read' name = 'layer_metadata_read'),*
>
> *    # Url (r '^ api / batch_permissions /? $', 'Batch_permissions'*
> *    # Name = 'batch_permssions'),*
> *    # Url (r '^ api / batch_delete /? $', 'Batch_delete' name =
> 'batch_delete'),*
> *)*
>
> I checked the possibility to address this, including metadata_read in the
> white list of security/ middleware.py file
>
> *white_list_paths = (*
> *        reverse ('account_login'),*
> *        reverse ('forgot_username'),*
> *        reverse ('help'),*
> *        reverse ('jscat'),*
> *        reverse ('lang'),*
> *        reverse ('layer_acls'),*
> *        reverse ('layer_acls_dep'),*
> *        reverse ('layer_resolve_user'),*
> *        reverse ('layer_resolve_user_dep'),*
>
> *        reverse ('metadata_read'),*
>
> *        '/account/(?!.*(?:signup))',*
> *        # Block unauthenticated users from creating new accounts.*
> *        '/ Static / *'*
> *    )*
>
> but neither worked.
>
>
> Can anyone help?
>
> Thank you.
>
> --
> Davi de O. Custódio
>
> _______________________________________________
> geonode-users mailing list
> geonode-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/geonode-users
>
>


-- 
Simone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/geonode-users/attachments/20150506/58b8f7c2/attachment.html>


More information about the geonode-users mailing list