Skip to content

User defined permissions will break the permissions exposed by the API #12639

@ridoo

Description

@ridoo

Expected Behavior

Create and add custom permissions to a user (via group) does not have any effect on handling user permissions.

Actual Behavior

Adding new permissions to a user, which are not known by GeoNode, raises an exception while mapping permissions in people/models.py#perms. As a result the API skips the perms attribute completely. With the API skipping that attribute, geonode-mapstore-client sees no permissions given to a user. For example a user who has actual contributor permissions, will not have the ability to (for example) add new resources.

Steps to Reproduce the Problem

See my discussion about custom permissions to reproduce.

  1. Add new user (id 1001) to contributor group
  2. Check /api/v2/users/1001 contains perms attribute
  3. Add a custom permission to a group a user belongs to
  4. Check /api/v2/users/1001 is missing perms attribute

Specifications

  • GeoNode version: 4.3.1 (but would affect older versions, which I did not test)
  • Installation type (vanilla, geonode-project):
  • Installation method (manual, docker):
  • Platform:
  • Additional details: Adding custom permissions #12635

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions