superset icon indicating copy to clipboard operation
superset copied to clipboard

Public Role

Open iamklaus opened this issue 6 years ago • 6 comments

I followed the documentation to grant access via public role to unauthorized users. I have also set PUBLIC_ROLE_LIKE_GAMMA = True in the config file.

Partly the access works, but superset gives the following message to the visitor:

"An error occurred while fetching available CSS templates"

Bug or missing configuration?

iamklaus avatar Apr 28 '20 19:04 iamklaus

Need a lot more info to reproduce

MarcusSorealheis avatar Apr 29 '20 16:04 MarcusSorealheis

@MarcusSorealheis I think what @iamklaus is trying to do is to access dashboards without logging in. I have a similar/related issue. I'm not setting PUBLIC_ROLE_LIKE_GAMMA to True but I'm giving the necessary permissions to the public role so he can access a dashboard, however without success.

I think the problem is on the method get_public_role of the SupersetSecurityManager here :point_down:

if not conf.get("PUBLIC_ROLE_LIKE_GAMMA", False):
    return None

from superset import db

return db.session.query(self.role_model).filter_by(name="Public").first()

Shouldn't it be like this :point_down: ?

from superset import db

if conf.get("PUBLIC_ROLE_LIKE_GAMMA", False):
    return db.session.query(self.role_model).filter_by(name="Gamma").first()

return db.session.query(self.role_model).filter_by(name="Public").first()

aspedrosa avatar May 01 '20 16:05 aspedrosa

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

stale[bot] avatar Jul 02 '20 07:07 stale[bot]

@iamklaus You have to also add the permission "can list on CssTemplateAsyncModelView"

aspedrosa avatar Jul 31 '20 08:07 aspedrosa

I am struggling with the same issue. Is there an update on this?

andreaphsz avatar Jun 08 '21 08:06 andreaphsz

I am struggling with the same issue. Is there an update on this?

When I created a dashboard and marked the table under Public along with some more permissions, I got the same error. "An error occurred while fetching available CSS templates"

After adding required permissions, it worked. Please see screenshot below for reference. image

extssam avatar Jul 12 '21 12:07 extssam