pulsar-manager icon indicating copy to clipboard operation
pulsar-manager copied to clipboard

Set read/write access to resource for each role

Open sourabhaggrawal opened this issue 3 years ago • 2 comments

Motivation

Assign resource level read/write access to each role of a user. This way we can assign multiple resources to a user with read/write permission.

  • A user may exist with multiple resource access where he/she is allowed to only read a particular resource while for other resource it can make changes.*

Modifications

    1. Added access field at role level which can have read or write as value.
    1. Added tenants field in resourceType list and will list available tenants in resource field while creating a role
    1. Added access map (Map<String,Map<String,String>>) in /usersInfo response, each key is the resourceType and value holds another map with resourcename as value and value as read/write.
    1. Added hasPermissionToResource method in module/users.js which is called for each actionable element when ui is rendered to decide to show/hide the resource based on access.
    1. Changes in .vue file to call the hasPermissionToResource method to decide if user has access to a particular element.

Verifying this change

  • [x] Make sure that the change passes the ./gradlew build checks.

sourabhaggrawal avatar Dec 29 '21 05:12 sourabhaggrawal

Hi @tuteng @eolivelli please take a look.

sourabhaggrawal avatar Jan 11 '22 03:01 sourabhaggrawal

Hi @tuteng Were you able to look into this PR? It would be a great help for us cc @sijie @merlimat

skyrocknroll avatar Jan 17 '22 05:01 skyrocknroll