geonode.geoserver.acl.acl_client ================================ .. py:module:: geonode.geoserver.acl.acl_client Attributes ---------- .. autoapisummary:: geonode.geoserver.acl.acl_client.logger Exceptions ---------- .. autoapisummary:: geonode.geoserver.acl.acl_client.ACLException Classes ------- .. autoapisummary:: geonode.geoserver.acl.acl_client.Rule geonode.geoserver.acl.acl_client.Batch geonode.geoserver.acl.acl_client.AutoPriorityBatch geonode.geoserver.acl.acl_client.AclClient geonode.geoserver.acl.acl_client.AclUtils Module Contents --------------- .. py:data:: logger .. py:exception:: ACLException Bases: :py:obj:`Exception` Common base class for all non-exit exceptions. .. py:class:: Rule(access: (str, bool), id=None, priority=None, workspace=None, layer=None, user=None, group=None, service=None, request=None, subfield=None, geo_limit=None, catalog_mode=None) Bases: :py:obj:`geonode.geoserver.acl.gsauth_client.models.Rule` Rule class inherited from gsauth_client.models.Rule but with some additional methods for Geofence format compatibility .. py:attribute:: ALLOW :value: 'ALLOW' .. py:attribute:: DENY :value: 'DENY' .. py:attribute:: LIMIT :value: 'LIMIT' .. py:attribute:: CM_MIXED :value: 'MIXED' .. py:attribute:: fields .. py:attribute:: _limits .. py:method:: set_priority(pri: int) .. py:method:: get_object() -> dict .. py:class:: Batch(log_name=None) _summary_ A ACL Batch. It's a list of operations that will be executed transactionally inside ACL (?). **Example**: .. code-block:: json { "Batch": { "operations": [ { "@service": "rules", "@type": "insert", "Rule": { "priority": 0, "user": "admin", "service": "WMS", "workspace": "geonode", "layer": "san_andres_y_providencia_administrative", "access": "ALLOW" } }, { "@service": "rules", "@type": "insert", "Rule": { "priority": 1, "user": "admin", "service": "GWC", "workspace": "geonode", "layer": "san_andres_y_providencia_administrative", "access": "ALLOW" } }, { "@service": "rules", "@type": "insert", "Rule": { "priority": 2, "user": "admin", "service": "WFS", "workspace": "geonode", "layer": "san_andres_y_providencia_administrative", "access": "ALLOW" } }, { "@service": "rules", "@type": "insert", "Rule": { "priority": 3, "user": "admin", "service": "WPS", "workspace": "geonode", "layer": "san_andres_y_providencia_administrative", "access": "ALLOW" } }, { "@service": "rules", "@type": "insert", "Rule": { "priority": 4, "user": "admin", "workspace": "geonode", "layer": "san_andres_y_providencia_administrative", "access": "ALLOW" } } ] } } :returns: Batch :rtype: _type_ .. py:attribute:: operations :value: [] .. py:attribute:: log_name .. py:method:: __str__() -> str .. py:method:: add_delete_rule(rule_id: int) .. py:method:: add_insert_rule(rule: Rule) .. py:method:: length() -> int .. py:method:: get_object() -> dict .. py:class:: AutoPriorityBatch(start_rule_pri: int, log_name=None) Bases: :py:obj:`Batch` _summary_ A Batch that handles the priority of the inserted rules. The first rule will have the declared `start_rule_pri`, next Rules will have the priority incremented. .. py:attribute:: pri .. py:method:: add_insert_rule(rule: Rule) .. py:class:: AclClient(host=None, username=None, password=None) .. py:attribute:: configuration .. py:attribute:: api_client .. py:attribute:: api_instance .. py:method:: insert_rule(rule) .. py:method:: delete_rule_by_id(rule_id) .. py:method:: run_batch(batch: Batch, timeout: int = None) -> bool .. py:method:: invalidate_cache() .. py:method:: get_first_available_priority() .. py:method:: count_all_rules() .. py:method:: get_rules(limit=None, next_cursor=None) .. py:class:: AclUtils(acl_client) .. py:attribute:: acl_client .. py:attribute:: api_instance .. py:method:: update_rule_by_id(rule_id, rule) .. py:method:: get_dataset_rules(workspace: str = None, layer: str = None) .. py:method:: collect_delete_layer_rules(workspace_name: str, layer_name: str, batch: Batch = None) -> Batch Collect delete operations in a Batch for all rules related to a layer .. py:method:: delete_layer_rules(workspace_name: str, layer_name: str) -> bool Delete all Rules related to a specific Layer .. py:method:: get_first_available_priority()