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

chore: cleanup FAB update perms #11155

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions UPDATING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ assists people when migrating to a new version.

## Next

* [11155](https://github.com/apache/incubator-superset/pull/11155): The `FAB_UPDATE_PERMS` config parameter is no longer required as the Superset application correctly informs FAB under which context permissions should be updated.

* [10887](https://github.com/apache/incubator-superset/pull/10887): Breaking change: The custom cache backend changed in order to support the Flask-Caching factory method approach and thus must be registered as a custom type. See [here](https://flask-caching.readthedocs.io/en/latest/#custom-cache-backends) for specifics.

* [10674](https://github.com/apache/incubator-superset/pull/10674): Breaking change: PUBLIC_ROLE_LIKE_GAMMA was removed is favour of the new PUBLIC_ROLE_LIKE so it can be set it whatever role you want.
Expand Down
17 changes: 0 additions & 17 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -276,23 +276,6 @@ server (`superset run` or `flask run`) is not intended for production use.
If not using gunicorn, you may want to disable the use of flask-compress
by setting `COMPRESS_REGISTER = False` in your `superset_config.py`

Flask-AppBuilder Permissions
----------------------------

By default, every time the Flask-AppBuilder (FAB) app is initialized the
permissions and views are added automatically to the backend and associated with
the ‘Admin’ role. The issue, however, is when you are running multiple concurrent
workers this creates a lot of contention and race conditions when defining
permissions and views.

To alleviate this issue, the automatic updating of permissions can be disabled
by setting `FAB_UPDATE_PERMS = False` (defaults to True).

In a production environment initialization could take on the following form:

superset init
gunicorn -w 10 ... superset:app

Configuration behind a load balancer
------------------------------------

Expand Down
16 changes: 0 additions & 16 deletions docs/src/pages/docs/installation/configuring.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,22 +65,6 @@ you can add the endpoints to `WTF_CSRF_EXEMPT_LIST`:
WTF_CSRF_EXEMPT_LIST = [‘’]
```

### Flask AppBuilder Permissions

By default, every time the Flask-AppBuilder (FAB) app is initialized the permissions and views are
added automatically to the backend and associated with the ‘Admin’ role. The issue, however, is when
you are running multiple concurrent workers this creates a lot of contention and race conditions
when defining permissions and views.

To alleviate this issue, the automatic updating of permissions can be disabled by setting
`FAB_UPDATE_PERMS = False` (defaults to True).

In a production environment initialization could take on the following form:

```
superset init gunicorn -w 10 … superset:app
```

### Running on a WSGI HTTP Server

While you can run Superset on NGINX or Apache, we recommend using Gunicorn in async mode. This
Expand Down
1 change: 0 additions & 1 deletion superset/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,6 @@ def configure_fab(self) -> None:
appbuilder.indexview = SupersetIndexView
appbuilder.base_template = "superset/base.html"
appbuilder.security_manager_class = custom_sm
appbuilder.update_perms = False
Copy link
Member Author

Choose a reason for hiding this comment

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

This is already False per here which is set by FAB either here and potentially reset here, though isn't since self.update_perms is already False.

appbuilder.init_app(self.flask_app, db.session)

def configure_url_map_converters(self) -> None:
Expand Down