Skip to content

Commit

Permalink
Managing perms for new views
Browse files Browse the repository at this point in the history
  • Loading branch information
mistercrunch committed Jul 23, 2015
1 parent b038d5a commit 74a2e7d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.db
tmp
local_config.py
app.db
Binary file removed app.db
Binary file not shown.
6 changes: 5 additions & 1 deletion app/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from flask.ext.appbuilder.models.sqla.interface import SQLAInterface
from flask.ext.appbuilder import ModelView, CompactCRUDMixin, BaseView, expose
from app import appbuilder, db, models, viz, utils
from flask.ext.appbuilder.security.decorators import has_access, permission_name
import config
from wtforms.fields import Field

Expand Down Expand Up @@ -54,6 +55,8 @@ class DatasourceModelView(ModelView):


class Panoramix(BaseView):
@has_access
@permission_name('datasources')
@expose("/datasource/<datasource_name>/")
def datasource(self, datasource_name):
viz_type = request.args.get("viz_type")
Expand All @@ -80,7 +83,8 @@ def datasource(self, datasource_name):
return obj.render_no_data()
return obj.render()


@has_access
@permission_name('refresh_datasources')
@expose("/refresh_datasources/")
def refresh_datasources(self):
import requests
Expand Down

0 comments on commit 74a2e7d

Please sign in to comment.