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

[API] Deprecate unnecessary /update_role/ API endpoint #4041

Merged

Conversation

john-bodley
Copy link
Member

@john-bodley john-bodley commented Dec 10, 2017

This PR removes the /update_role/ API endpoint which it seems was added specifically for an Airbnb use case. The endpoint appends users (new or existing) to a role which is invoked for syncing external permissions. The issue with this approach is it merely grants permissions and never revokes.

This use case seems very tailored, and thus rather than adding additional API endpoints to removes users it seems a more prudent approach would be to leverage the FAB REST API. Specifically the same functionality can be achieved via something of the form,

import request

# Create a new user.
requests.put(
    'http://localhost:8088/users/api/create',
    data={
        'username': 'john_doe',		
        'first_name': 'John',		
        'last_name': 'Doe',		
        'email': '[email protected]',
    },
)

# Set the list of users associated with the 'Alpha' role.
request.put(
    'http://localhost:8088/roles/api/update/3',
    data={'name': 'Alpha', 'user': [1, 2, 3]},
)

which defines the set of users (via primary key) associated with the Alpha role. This method provides the ability to add or remove users since the the user list defines the complete set of users associated with said role.

to: @mistercrunch

@john-bodley john-bodley force-pushed the john-bodley-remove-update-role branch from 04f6385 to 2bf64c1 Compare December 11, 2017 00:48
@mistercrunch
Copy link
Member

In general we try to not ship backwards incompatible changes, but I'm guessing this is only used at Airbnb and we're pre 1.0, so let's turn this endpoint off.

@mistercrunch mistercrunch merged commit 3a2974f into apache:master Dec 11, 2017
michellethomas pushed a commit to michellethomas/panoramix that referenced this pull request May 24, 2018
wenchma pushed a commit to wenchma/incubator-superset that referenced this pull request Nov 16, 2018
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.2 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.21.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants