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

Unable to use Flask-FontAwesome: the css and js are 403 blocked #34

Open
elanor-sparx opened this issue Apr 28, 2022 · 0 comments
Open

Comments

@elanor-sparx
Copy link

Note, I have app.config['RBAC_USE_WHITE'] = True in my app.

This issue probably applies to other packages that initialise the css/js from the app and include it in the html headers like

<head>
    ...
    {{ fontawesome_html() }}
    ...
</head>

The solution in my case is to exempt the endpoint "fontawesome.static". Decided to work-around thusly in order to populate the _exempt list for each instance:

MRBAC.py

from flask_rbac import RBAC


class MRBAC(RBAC):

    ADDITIONAL_EXEMPTIONS = [
        "fontawesome.static"
    ]

    def __init__(self):
        super().__init__()
        self.do_additional_exemptions()

    def do_additional_exemptions(self):
        for e in self.ADDITIONAL_EXEMPTIONS:
            self.acl.exempt(e)


rbac = MRBAC()

and in the application's init.py:

from app.MRBAC import MRBAC
rbac = MRBAC()
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

No branches or pull requests

1 participant