geonode.security.permissions
Permissions will be managed according to a “compact” set:
view: view resource
download: view and download
edit: view download and edit (metadata, style, data)
manage: change permissions, delete resource, etc.
The GET method will return:
users:
username
first name
last name
permissions (view | download | edit | manage)
organizations:
title
name
permissions (view | download | edit | manage)
groups:
title
name
permissions (view | download | edit | manage)
Attributes
Exceptions
Something in the API has changed |
Classes
Functions
|
Explode "compact" permissions into an "extended" set, accordingly to the schema below: |
|
Compress standard permissions into a "compact" set, accordingly to the schema below: |
|
|
|
Transforms an extended "perm_spec" into a list of compact perms. |
Module Contents
- geonode.security.permissions.DATA_STYLABLE_RESOURCES_SUBTYPES = ['raster', 'vector', 'vector_time'][source]
- geonode.security.permissions.EDIT_PERMISSIONS = ['change_resourcebase', 'change_resourcebase_metadata'][source]
- geonode.security.permissions.BASIC_MANAGE_PERMISSIONS = ['delete_resourcebase', 'change_resourcebase_permissions'][source]
- geonode.security.permissions.SERVICE_PERMISSIONS = ['add_service', 'delete_service', 'change_resourcebase_metadata', 'add_resourcebase_from_service'][source]
- geonode.security.permissions._to_extended_perms(perm: str, resource_type: str = None, resource_subtype: str = None, is_owner: bool = False) list[source]
Explode “compact” permissions into an “extended” set, accordingly to the schema below:
view: view resource
download: view and download
edit: view download and edit (metadata, style, data)
manage: change permissions, delete resource, etc.
owner: admin permissions
- geonode.security.permissions._to_compact_perms(perms: list, resource_type: str = None, resource_subtype: str = None, is_owner: bool = False) str[source]
Compress standard permissions into a “compact” set, accordingly to the schema below:
view: view resource
download: view and download
edit: view download and edit (metadata, style, data)
manage: change permissions, delete resource, etc.
owner: admin permissions
- exception geonode.security.permissions.BindingFailed[source]
Bases:
ExceptionSomething in the API has changed
- class geonode.security.permissions.PermSpecConverterBase(json, resource, parent=None)[source]
Bases:
object
- class geonode.security.permissions.PermSpec(json, resource, parent=None)[source]
Bases:
PermSpecConverterBase- property compact[source]
- Converts a standard and verbose 'perm_spec' into 'compact mode'.
This method also recognizes special/internal security groups, such as ‘anonymous’ and ‘registered-members’, and places their permissions in a specific node called ‘groups’.
Every security group different from the former ones, associated with a GeoNode ‘GroupProfile’, will instead be placed in a node called ‘organizations’.
Example:
{ "users": [ { "id": 1001, "username": "afabiani", "first_name": "", "last_name": "", "avatar": "", "permissions": "manage", "is_superuser": true, "is_staff": false } ], "organizations": [], "groups": [ { "id": 3, "title": "Registered Members", "name": "registered-members", "permissions": "edit" }, { "id": 2, "title": "anonymous", "name": "anonymous", "permissions": "download" } ] }
- class geonode.security.permissions.PermSpecUserCompact(json, resource, parent=None)[source]
Bases:
PermSpecConverterBase
- class geonode.security.permissions.PermSpecGroupCompact(json, resource, parent=None)[source]
Bases:
PermSpecConverterBase
- class geonode.security.permissions.PermSpecCompact(json, resource, parent=None)[source]
Bases:
PermSpecConverterBase- property extended[source]
- Converts a 'perm_spec' in 'compact mode' into a standard and verbose format.
Example:
{ "groups": { "<Group: registered-members>": [ "view_resourcebase", "download_resourcebase", "change_resourcebase" ], "<Group: anonymous>": [ "view_resourcebase" ] }, "users": { "<Profile: AnonymousUser>": [ "view_resourcebase" ], "<Profile: afabiani>": [ "view_resourcebase", "download_resourcebase", "change_resourcebase_metadata", "change_resourcebase", "delete_resourcebase", "change_resourcebase_permissions", "publish_resourcebase" ] } }
- merge(perm_spec_compact_patch: PermSpecCompact)[source]
Merges ‘perm_spec_compact_patch’ to the current one.
Existing elements will be overridden.
Non existing elements will be added.
If you need to delete elements you cannot use this method.