Skip to content

Commit

Permalink
chore: cleanup FAB update perms (#11155)
Browse files Browse the repository at this point in the history
* chore: Using cache factory method

* chore: Deprecate outdated FAB_UPDATE_PERMS information

Co-authored-by: John Bodley <john.bodley@airbnb.com>
  • Loading branch information
john-bodley and John Bodley committed Oct 7, 2020
1 parent 32e174d commit 6e0d1b8
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 34 deletions.
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
appbuilder.init_app(self.flask_app, db.session)

def configure_url_map_converters(self) -> None:
Expand Down

0 comments on commit 6e0d1b8

Please sign in to comment.