mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-07 13:34:55 +08:00
Fix bug with disabled authorization
This commit is contained in:
parent
2928fab261
commit
ef9cd47978
2 changed files with 7 additions and 5 deletions
|
@ -316,7 +316,9 @@ defmodule Livebook.Hubs.TeamClient do
|
|||
if id = state.deployment_group_id do
|
||||
case fetch_deployment_group(id, state) do
|
||||
{:ok, deployment_group} ->
|
||||
{:reply, authorized_group?(deployment_group.authorization_groups, groups), state}
|
||||
{:reply,
|
||||
not deployment_group.groups_auth or
|
||||
authorized_group?(deployment_group.authorization_groups, groups), state}
|
||||
|
||||
_ ->
|
||||
{:reply, false, state}
|
||||
|
@ -331,8 +333,9 @@ defmodule Livebook.Hubs.TeamClient do
|
|||
with {:ok, deployment_group} <- fetch_deployment_group(id, state),
|
||||
{:ok, app_deployment} <- fetch_app_deployment_from_slug(slug, state) do
|
||||
app_access? =
|
||||
authorized_group?(deployment_group.authorization_groups, groups) or
|
||||
authorized_group?(app_deployment.authorization_groups, groups)
|
||||
not deployment_group.groups_auth or
|
||||
(authorized_group?(deployment_group.authorization_groups, groups) or
|
||||
authorized_group?(app_deployment.authorization_groups, groups))
|
||||
|
||||
{:reply, app_access?, state}
|
||||
else
|
||||
|
@ -700,7 +703,6 @@ defmodule Livebook.Hubs.TeamClient do
|
|||
|
||||
defp handle_event(:deployment_group_created, %Teams.DeploymentGroup{} = deployment_group, state) do
|
||||
Teams.Broadcasts.deployment_group_created(deployment_group)
|
||||
|
||||
put_deployment_group(state, deployment_group)
|
||||
end
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ defmodule Livebook.ZTA.LivebookTeams do
|
|||
} = payload
|
||||
|
||||
restricted_apps_groups =
|
||||
if Livebook.Hubs.TeamClient.authorization_groups_enabled?(hub_id) and
|
||||
if not Livebook.Hubs.TeamClient.authorization_groups_enabled?(hub_id) or
|
||||
Livebook.Hubs.TeamClient.user_full_access?(hub_id, groups) do
|
||||
nil
|
||||
else
|
||||
|
|
Loading…
Add table
Reference in a new issue