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

Problems with Public role after updating #9807

Closed
JMGGarcia opened this issue May 14, 2020 · 5 comments · Fixed by #10674
Closed

Problems with Public role after updating #9807

JMGGarcia opened this issue May 14, 2020 · 5 comments · Fixed by #10674

Comments

@JMGGarcia
Copy link

Hello! I've been running an older version of Superset without a problem, where I embed some dashboards on my website and through the Public user role permissions it is possible to see and use the dashboards.

However, after updating to version 0.36 (using docker) I've been having problems providing public access to my dashboards. Without changing any user role settings, I get Access Denied messages when before I was able to access the dashboard.

The only way I found around this is to set PUBLIC_ROLE_LIKE_GAMMA = True in the superset_config.py and then add the necessary permissions. However, every time I restart the server, it overwrites whatever permissions I've added and I have to add them again. If I put this setting back to False again, when I restart, the previous behavior comes up, where the public can't access the dashboard.

It seems that for some reason Superset doesn't recognize the public user role unless if it is innitiated through the PUBLIC_ROLE_LIKE_GAMMA setting.

Any ideas of what could be done to fix this? Thanks!

@mistercrunch
Copy link
Member

Just reproduced this, it appears running superset init resets Public to be exactly like Alpha (removes what was added manually)

@mistercrunch
Copy link
Member

As a workaround, you may be able to set PUBLIC_ROLE_LIKE_GAMMA = True, run superset init, set PUBLIC_ROLE_LIKE_GAMMA = False and then alter Public role.

@JMGGarcia
Copy link
Author

I still get the same behavior of not being able to view the public dashboards doing that. Just to be clear, regardless of the user permissions, I still get Access Denied when trying to view a public dashboard. So, even though doing what you said did not overwrite the permissions, I still couldn't access the public dashboards (it seems it stops recognizing the public role).

However, I solved my problem by removing the superset_init container from docker-compose (after the first startup). I'm not sure if this is the intended behavior though...

@aspedrosa
Copy link

Having the same problem
@mistercrunch @bkyryliuk
Shouldn't this line be

if conf.get("PUBLIC_ROLE_LIKE_GAMMA", False):

or even

if conf.get("PUBLIC_ROLE_LIKE_GAMMA", False):
    return (
        self.get_session.query(self.role_model)
        .filter_by(name="Gamma")
        .one_or_none()
    )

?

@dpgaspar
Copy link
Member

Hey,

#10674 fixes this issue, a rerun of superset init will keep all data access permissions on the public role. Also introduces a new way of configuring a pre defined public role.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants