clevercanary / hca-atlas-tracker

Apache License 2.0
0 stars 0 forks source link

Example SQL for creating users with role related resources #355

Closed NoopDog closed 1 day ago

NoopDog commented 2 days ago

@Hunter can you provide an example of how to create a user with and without the new roleRelatedResource field? How do I create a STAKEHOLDER? How do I create a INTEGRATION_LEAD and assign the lead a one or more atlases?

hunterckx commented 2 days ago

Create a stakeholder named Foo:

INSERT INTO hat.users (disabled, email, full_name, role, role_associated_resource_ids) VALUES ('f', 'foo@example.com', 'Foo', 'STAKEHOLDER', '{}');

Create an integration lead of two atlases:

INSERT INTO hat.users (disabled, email, full_name, role, role_associated_resource_ids) VALUES ('f', 'bar@example.com', 'Bar', 'INTEGRATION_LEAD', '{01234567-89ab-cdef-0123-456789abcdef, fedcba98-7654-3210-fedc-ba9876543210}');

(The role_associated_resource_ids array contains atlas IDs and can be given as many or as few as necessary)

NoopDog commented 1 day ago

Ok thx!