Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • C catalog.genesys-pgr.org
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 13
    • Issues 13
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Genesys PGRGenesys PGR
  • Genesys Catalog
  • catalog.genesys-pgr.org
  • Issues
  • #127
Closed
Open
Issue created Dec 18, 2017 by Matija Obreza@mobrezaOwner

Use _permission data

In we added support for enhancing JSON objects with permissions for the current user:

{
	"uuid": "95493e3d-ccf4-4357-803a-7632c5fda034",
	"id": 1,
	"version": 1,
	"active": true,
	"createdBy": 1,
	"createdDate": 1513622186000,
	"lastModifiedBy": 1,
	"lastModifiedDate": 1513622203000,
	"shortName": "GCDT",
	"name": "Global Crop Diversity Trust",
	"description": "The Global Crop Diversity Trust is an international organization with Headquarters in Bonn, Germany whose mission is to ensure the conservation and availability of crop diversity for food security worldwide.",
	"urls": null,
	"wiewsCodes": null,
	"_permissions": {
		"create": true,
		"read": true,
		"write": true,
		"delete": true,
		"manage": true
	}
}

The _permissions property is automagically added to all objects that support ACL security on the server (examples Partner, Dataset, Descriptor, ...).

  1. Declare a class CurrentPermissions with boolean properties as seen above (create, read, ...)
  2. Declare an interface IUserPermissions in the client model with _permissions: CurrentPermissions;
  3. Update relevant class declarations of the model to implement IUserPermissions
  4. Update user interface so that Edit or Delete buttons are displayed when write===true or delete===true respectively.

Example

The "Edit" button on https://catalog.demo.genesys-pgr.org/partner/95493e3d-ccf4-4357-803a-7632c5fda034 should only be displayed if the _permissions.write of this Partner record is true.

Edited Dec 19, 2017 by Matija Obreza
Assignee
Assign to
Time tracking