Skip to content

Commit 39f62d7

Browse files
committed
Removing current_user as that can be obtained via additional_params
1 parent 529abd3 commit 39f62d7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/superset/guest_token.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@ module Superset
22
class GuestToken
33
include Credential::EmbeddedUser
44

5-
attr_accessor :embedded_dashboard_id, :current_user, :rls_clause, :additional_params
5+
attr_accessor :embedded_dashboard_id, :rls_clause, :additional_params
66

7-
def initialize(embedded_dashboard_id: , current_user: nil, rls_clause: [], **additional_params)
7+
def initialize(embedded_dashboard_id:, rls_clause: [], **additional_params)
88
@embedded_dashboard_id = embedded_dashboard_id
9-
@current_user = current_user
109
@rls_clause = rls_clause
1110
@additional_params = additional_params
1211
end
@@ -37,8 +36,9 @@ def validate_params
3736
# optional param to be available in Superset for query templating using jinja
3837
# ss expects username .. which could be used to query as current_user.id
3938
def current_user_params
40-
if current_user
41-
{ "username": current_user.id.to_s }
39+
current_user_id = additional_params[:embedded_app_current_user_id]
40+
if current_user_id
41+
{ "username": current_user_id.to_s }
4242
else
4343
{ }
4444
end

0 commit comments

Comments
 (0)