Implementation of guadian custom permissions

This PR implements or ends implementing the following django-guardian custom permissions, that will integrate the existing standard ones (change_resourcebase, add_resourcebase, delete_resourcebase):

* view_resourcebase
* change_resourcebase_metadata
* change_resourcebase_permissions
* download_resourcebase
* publish_resourcebase
* change_layer_data
* change_layer_style

All of the permissions are tested, and the user interface has been updated to let the user manage the new permissions structure for every GeoNode object type (layer/map/document)
Some basic documentation update is provided.

Some observations:

* view_resourcebase and change_resourcebase_metadata must be handled in the catalog as well, see #1726 
* download_resourcebase is only consistent with the GeoNode interface. If a user is able to guess the WFS link for a layer, he will be still able to download it. This should be solved by proxying GeoServer and implementing GNIP-47
* change_layer_style is handled proxying the REST request to GeoServer, therefore the GeoServer plugin has not been impacted by this
* publish_resourcebase implementation will be provided with a different PR in the next days
Hi Simone

the change_layer, delete_layer and add_layer are returned by default
by the get_users_with_perms and get_groups_with_perms guardian
shortcuts.
Specifically, they are returned for an admin user.
I don't see an easy way to avoid the check is done here, an
alternative would be to remove the items after the info_layer
dictionary is returned here:
https://github.com/capooti/geonode/blob/custom-permissions/geonode/security/models.py#L70

but wouldn't be the same?¶
p

On Wed, Nov 5, 2014 at 8:40 AM, Simone Dalmasso
<notifications@github.com> wrote:
> In geonode/security/models.py:
>
>>          if 'users' in perm_spec:
>>              for user, perms in perm_spec['users'].items():
>>                  user = get_user_model().objects.get(username=user)
>>                  for perm in perms:
>> -                    assign_perm(perm, user, self.get_self_resource())
>> +                    if self.polymorphic_ctype.name == 'layer' and perm in
>> ('add_layer', 'change_layer', 'delete_layer', 'change_layer_data',
>> 'change_layer_style'):
>
> Could you remove 'add_layer', 'change_layer', 'delete_layer' because it
> would be an error to use them.
>
> —
> Reply to this email directly or view it on GitHub.



-- 
Paolo Corti
Geospatial software developer
web: http://www.paolocorti.net
twitter: @capooti
skype: capooti