Skip to content

Assign resource ownership to administrator during resource creation configurable via settings #13965

@sijandh35

Description

@sijandh35

📝 Introduction

User Story:
As a User, I want to assign the reosurce ownership to the administrator during the resource creation, by defining the username in the settings file.

Problem Statement:

Not all the plaform wants the user that upload the resource to be the owner of the resource itself, but wants that the administrator will be the only owner of the resources in the platform.
At the moment this is not possible since by default the user creates a resource the data is always the owner of the resource itself.
The idea is to create a system where, by specifing few settings, the system will automatically assing the ownership of the resource to the administrator and assign the "manage" permissions to the user itself.

Ideally will be possible to define the following two settings in the application:

AUTO_ASSIGN_RESOURCE_OWNERSHIP_TO_ADMIN = os.getenv("AUTO_ASSIGN_RESOURCE_OWNERSHIP_TO_ADMIN", "False") # define if the function is enabled
RESOURCE_OWNERSHIP_ADMIN_USERNAME = os.getenv("RESOURCE_OWNERSHIP_ADMIN_USERNAME", "admin") # define the username of the administrator to assing the ownership to

NOTE: The above configuration MUST be value and choerent with all the resource available


✅ Criteria

  • Settings setup: It will be possible to set the two envs.
  • Consistency and warnings: If the AUTO_ASSIGN_RESOURCE_OWNERSHIP_TO_ADMIN is set but RESOURCE_OWNERSHIP_ADMIN_USERNAME is not, we should log a warning in the settings file (via log) which sayis that the ownership will be provided to the default username admin
  • User evaluation: the user defined in RESOURCE_OWNERSHIP_ADMIN_USERNAME must be a superuser. The evaluation of the can be done during the creation. If the user provided is not ad administrator, the system should log an error and assign the resource to the first admin available.
  • Permissions assign: The user defined in RESOURCE_OWNERSHIP_ADMIN_USERNAME should be the owner of the resource, while the initial user must have the manage permissions. If later the permissions are altered via the share panel, the new permissions must be set
  • Code consistency: the method responsible to manage this, should be defined as a handler in the permissions registry and it must override any other permission defined by default in GeoNode
  • Creation only: the above should not be applied if the user update the resource (example via the metadata editor) but only during the creation phase

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions