Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GET api?attributes=authorization should return more than an array of strings for groups #74

Closed
AllenBW opened this issue Sep 25, 2017 · 4 comments

Comments

@AllenBW
Copy link
Member

AllenBW commented Sep 25, 2017

While mildly helpful, the array of strings, better would be an array of full group objects that below to the user when this call is made:GET http://localhost:3000/api?attributes=authorization

  "identity": {
    "userid": "admin",
    "name": "Administrator",
    "user_href": "http://localhost:3000/api/users/10000000000001",
    "group": "EvmGroup-super_administrator",
    "group_href": "http://localhost:3000/api/groups/10000000000002",
    "role": "EvmRole-super_administrator",
    "role_href": "http://localhost:3000/api/roles/10000000000001",
    "tenant": "Red Hat",
    "groups": [
      "Tenant My Company access",
      "EvmGroup-super_administrator"
    ]
  }

@imtayadeway 👾 💅 ‼️

@abellotti
Copy link
Member

keeping current groups array returned as is (ye-old compatibility) but maybe some additional details separately.

@AllenBW what info out of groups do you need ? with all groups details, might be tons of data, we may want to only return that if attributes=authorization, "identity" is always returned but we can extend with an miq_groups element when attributes=authorization

@AllenBW
Copy link
Member Author

AllenBW commented Sep 26, 2017

see i did that! added the miq_groups attribute... it didn't do much... all i need/want is an id or href for the groups, of course can be gotten by doing a call on api/groups and matching em on the client... but that kinda seems crazy to make another call :-/

@abellotti
Copy link
Member

If this is something you need back with each call with attributes=authorization,

Maybe something like this ?

  "identity": {
    "userid": "admin",
    "name": "Administrator",
    "user_href": "http://localhost:3000/api/users/10000000000001",
    "group": "EvmGroup-super_administrator",
    "group_href": "http://localhost:3000/api/groups/10000000000002",
    "role": "EvmRole-super_administrator",
    "role_href": "http://localhost:3000/api/roles/10000000000001",
    "tenant": "Red Hat",
    "groups": [
      "Tenant My Company access",
      "EvmGroup-super_administrator"
    ],
    "miq_groups" : [
        {
           "description" : "Tenant My Company access",
           "href" : "http://localhost:3000/api/groups/1000000000021",
           "id" : "1000000000021"
        },
        {
            "description" : "EvmGroup-super_administrator",
            "href" : "http://localhost:3000/api/groups/1000000000002",
             "id": "1000000000002",
        }
    ]
  }

@AllenBW
Copy link
Member Author

AllenBW commented Sep 26, 2017

@abellotti GOSH YES!!!! This would save the day

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants