superset icon indicating copy to clipboard operation
superset copied to clipboard

Problems with Public role after updating

Open JMGGarcia opened this issue 6 years ago • 5 comments

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!

JMGGarcia avatar May 14 '20 18:05 JMGGarcia

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

mistercrunch avatar May 15 '20 04:05 mistercrunch

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.

mistercrunch avatar May 15 '20 05:05 mistercrunch

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...

JMGGarcia avatar May 15 '20 15:05 JMGGarcia

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()
    )

?

aspedrosa avatar Jul 31 '20 09:07 aspedrosa

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.

dpgaspar avatar Aug 26 '20 12:08 dpgaspar