bcgov / gwa

Gateway Administration
https://catalogue.data.gov.bc.ca/dataset/api-gateway-administration
Apache License 2.0
7 stars 3 forks source link

Group Name Management #10

Closed ll911 closed 7 years ago

ll911 commented 7 years ago

cannot add an group without group members

pauldaustin commented 7 years ago

Groups can be added without members. It's just that the group doesn't persist in the main list of groups without any users as kong doesn't have a table listing groups. Just the acls table.

I'm making a couple of changes.

  1. Add list of groups that are on the acls for an api. So for an API you can view the groups even if there are no members.
  2. Added gwa_admin and gwa_api_owner groups so they are always in the list of groups.
pauldaustin commented 7 years ago

Work with the Kong team to manage the list of supported group names within the Kong database. This will be donated to the Kong project.

Update the GWA to use the new Kong functionality.

pauldaustin commented 7 years ago

Actually implemented in the bcgov gwa-plugin.

I have added a group_names table to the kong config which is created by migrations. Those migrations auto create entries for any existing acl entries.

It has hooks so that when you add a new group name in the acl table the group_names gets created. Likewise if you delete a group_name it will DELETE all the acls that use the group name.

BK01 commented 7 years ago

Verified. Group can be added without any users. However, the group will not be listed in the main group list for the reasons listed above.

BK01 commented 7 years ago

@pauldaustin When attempting to remove a user (gwa-d) from a group by clicking the red g-can icon, we are presented with a message 'Delete Group? Are you sure you want to delete Group: group name'. image

pauldaustin commented 7 years ago

Brian,

Please include a screen shot. The message I get includes the group name on the line after 'Are you sure you want to delete Group: '.

pauldaustin commented 7 years ago

Brian,

That looks exactly correct.

BK01 commented 7 years ago

In this case, we wish to remove one single user, rather than delete the entire group. For example, remove BK01 from the test2 group. Not delete the test2 group.

pauldaustin commented 7 years ago

I completely missed the page you were on as this issue was about the groups page not the users in a group page.

pauldaustin commented 7 years ago

I'll replace Group with User from Group

BK01 commented 7 years ago

Perfect. Thank you Paul

pauldaustin commented 7 years ago

There was one piece missing. If you added a group from the /groups page. But then didn't add a user to the group it didn't persist the in the database. If however you added a group to a user then it auto created a group in the database.

Now when you enter a group name and click the Add Group on the /groups page it will create the group in the database. Regardless if it existed or not it will take you to the user listing for that page.

BK01 commented 7 years ago

fix verified in gwa-d for both addition of new groups without users, and the removal of individual users from a group.