Skip to content

Commit

Permalink
Authorization checks in server.py
Browse files Browse the repository at this point in the history
This commit adds a single parameter used in the
`config.authorize_callback` that allows the user supplied method to
check if an app user is authorized to view the requested app at the
given path.

Resolves holoviz#3179
  • Loading branch information
ndmlny-qs committed Aug 10, 2023
1 parent 47c4a05 commit ade84b9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion panel/io/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ async def get(self, *args, **kwargs):
token = session.token
logger.info(LOG_SESSION_CREATED, id(session.document))
with set_curdoc(session.document):
if config.authorize_callback and not config.authorize_callback(state.user_info):
if config.authorize_callback and not config.authorize_callback(state.user_info, self.request.path):
if config.auth_template:
with open(config.auth_template) as f:
template = _env.from_string(f.read())
Expand Down

0 comments on commit ade84b9

Please sign in to comment.