Skip to content
This repository has been archived by the owner on Jul 28, 2023. It is now read-only.

Add table turbot_grant closes #12 #15

Merged
merged 19 commits into from
Jan 24, 2022
Merged

Add table turbot_grant closes #12 #15

merged 19 commits into from
Jan 24, 2022

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Nov 25, 2021

Example query results

Results
> select id, identity_status, ientity_family_name,level_trunk_title from turbot_active_grant
+-----------------+-----------------+---------------------+-------------------------------------------------------+
| id              | identity_status | ientity_family_name | level_trunk_title                                     |
+-----------------+-----------------+---------------------+-------------------------------------------------------+
| 161525342357056 | Active          | Smyth               | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 229155810239578 | Active          | Behera              | SuperUser                                             |
| 228825782849182 | Active          | Chakraborty         | SuperUser                                             |
| 216704470305117 | Active          | Das                 | User > Metadata > ReadOnly > Operator > Admin         |
| 232513631394343 | Active          | Behera              | User > Metadata > ReadOnly > Operator                 |
| 240323569425816 | Active          | Behera              | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 165127150940754 | Active          | Kumbha              | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 228825782907553 | Active          | Chakraborty         | User > Metadata > ReadOnly                            |
| 232514598645748 | Active          | Bhardwaj            | Role                                                  |
| 240323894253012 | Active          | Misra               | SuperUser                                             |
| 162687942600473 | Active          | Hadianto            | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 188609043625517 | Active          | Wallace             | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 189875991944587 | Active          | Bhardwaj            | SuperUser                                             |
| 162654220386929 | Active          | Bruno               | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 187951536899783 | Active          | Mohanty             | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 189793356024239 | Active          | Bhardwaj            | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 165127150928460 | Active          | Basu                | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 162199372503739 | Active          | Burgess             | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 240323832580553 | Active          | Misra               | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 162654220385904 | Active          | Bruno               | User > Metadata > ReadOnly > Operator > Admin         |
| 232513631215140 | Active          | Behera              | User > Metadata > ReadOnly > Operator                 |
| 161241086036962 | Active          | Admin               | User > Metadata > ReadOnly > Operator > Admin > Owner |
| 187955963611958 | Active          | Mohanty             | SuperUser                                             |
| 241556185269454 | Inactive        | Nayak               | User > Metadata                                       |
| 212996033743000 | Active          | Khuntia             | User > Metadata > ReadOnly > Operator > Admin         |
+-----------------+-----------------+---------------------+-------------------------------------------------------+

@ParthaI ParthaI self-assigned this Nov 25, 2021
@ParthaI ParthaI marked this pull request as draft November 25, 2021 05:02
},
Columns: []*plugin.Column{
// Top columns
{Name: "id", Type: proto.ColumnType_INT, Transform: transform.FromField("Turbot.ID"), Description: "Unique identifier of the grant."},
Copy link
Contributor

@rajlearner17 rajlearner17 Nov 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
{Name: "id", Type: proto.ColumnType_INT, Transform: transform.FromField("Turbot.ID"), Description: "Unique identifier of the grant."},
{Name: "id", Type: proto.ColumnType_INT, Transform: transform.FromField("Turbot.ID"), Description: "Unique identifier of the grantee."},

grant > grantee or actor

@rajlearner17
Copy link
Contributor

@ParthaI I would suggest having a turbot_grant table to capture grantee with status (Active/Inactive) and associated grants (Permissions)

@LalitLab LalitLab linked an issue Nov 30, 2021 that may be closed by this pull request
Copy link
Contributor

@cbruno10 cbruno10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see suggestions

General guidelines:

  • Convert the field name into snake case
  • Omit the word turbot in the column name
  • Sometimes add the word grant or active_grant if there's ambiguity with another column name that's very close, e.g., identity_status vs. grant_status

turbot/table_turbot_grant.go Outdated Show resolved Hide resolved
turbot/table_turbot_grant.go Outdated Show resolved Hide resolved
turbot/table_turbot_grant.go Outdated Show resolved Hide resolved
turbot/table_turbot_grant.go Outdated Show resolved Hide resolved
turbot/table_turbot_grant.go Outdated Show resolved Hide resolved
turbot/table_turbot_grant.go Outdated Show resolved Hide resolved
turbot/table_turbot_grant.go Outdated Show resolved Hide resolved
turbot/table_turbot_grant.go Outdated Show resolved Hide resolved
@ParthaI ParthaI marked this pull request as ready for review December 8, 2021 15:12
@ParthaI ParthaI changed the title Add table turbot_grant and turbot_active_grants closes #12 Add table turbot_grant closes #12 Dec 15, 2021
Copy link
Contributor

@cbruno10 cbruno10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ParthaI Please see comments, thanks!

A lot of comments are around field naming, we had established some guidelines in #15 (review), was there a reason you deviated from these here?

Also, I think there's a similar column naming issue I didn't include in this review, but did for active_grant here #24 (comment).

docs/tables/turbot_grant.md Show resolved Hide resolved

## Examples

### List all turbot grants
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### List all turbot grants
### Basic info

{Name: "level_title", Type: proto.ColumnType_STRING, Transform: transform.FromField("Level.Title"), Description: "The title of the level."},
{Name: "level_trunk_title", Type: proto.ColumnType_STRING, Transform: transform.FromField("Level.Trunk.Title"), Description: "Full title (including ancestor trunk) of the level."},
{Name: "level_uri", Type: proto.ColumnType_STRING, Transform: transform.FromField("Level.URI"), Description: "The URI of the level."},
{Name: "type_trunk_title", Type: proto.ColumnType_STRING, Transform: transform.FromField("Resource.Type.Trunk.Title"), Description: "Full title (including ancestor trunk) of the grant type."},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this column and the one below not include the word resource, but the others below it do with similar property paths?

@cbruno10 cbruno10 merged commit 2bbd68c into main Jan 24, 2022
@cbruno10 cbruno10 deleted the issue-12 branch January 24, 2022 14:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add table turbot_grant
3 participants