-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[security] allow for requesting access when denied on a dashboard view (
#1192) * Request access on dashboard view * Fixing the unit tests * Refactored much in the tests
- Loading branch information
1 parent
d066f8b
commit 472679b
Showing
10 changed files
with
533 additions
and
465 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
caravel/migrations/versions/ab3d66c4246e_add_cache_timeout_to_druid_cluster.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""add_cache_timeout_to_druid_cluster | ||
Revision ID: ab3d66c4246e | ||
Revises: eca4694defa7 | ||
Create Date: 2016-09-30 18:01:30.579760 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'ab3d66c4246e' | ||
down_revision = 'eca4694defa7' | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
op.add_column( | ||
'clusters', sa.Column('cache_timeout', sa.Integer(), nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column('clusters', 'cache_timeout') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"""empty message | ||
Revision ID: ef8843b41dac | ||
Revises: ('3b626e2a6783', 'ab3d66c4246e') | ||
Create Date: 2016-10-02 10:35:38.825231 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = 'ef8843b41dac' | ||
down_revision = ('3b626e2a6783', 'ab3d66c4246e') | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
pass | ||
|
||
|
||
def downgrade(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,20 @@ | ||
{% extends "caravel/basic.html" %} | ||
{% block title %}{{ _("No Access!") }}{% endblock %} | ||
{% block body %} | ||
<div class="container"> | ||
{% include "caravel/flash_wrapper.html" %} | ||
<div class="container"> | ||
<h4> | ||
{{ _("You do not have permissions to access the datasource %(name)s.", | ||
name=datasource_name) | ||
}} | ||
</h4> | ||
<div id="buttons"> | ||
<button onclick="window.location.href = '{{ request_access_url }}';" | ||
id="request" | ||
> | ||
{{ _("Request Permissions") }} | ||
</button> | ||
<button onclick="window.location.href = '{{ slicemodelview_link }}';" | ||
id="cancel" | ||
> | ||
{{ _("Cancel") }} | ||
</button> | ||
</div> | ||
<h4> | ||
{{ _("You do not have permissions to access the datasource(s): %(name)s.", | ||
name=datasource_names) | ||
}} | ||
</h4> | ||
<div> | ||
<button onclick="window.location += '&action=go';"> | ||
{{ _("Request Permissions") }} | ||
</button> | ||
<button onclick="window.location.href = '/slicemodelview/list/';"> | ||
{{ _("Cancel") }} | ||
</button> | ||
</div> | ||
{% endblock %} | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
echo $DB | ||
rm -f .coverage | ||
export CARAVEL_CONFIG=tests.caravel_test_config | ||
set -e | ||
caravel/bin/caravel version -v | ||
export SOLO_TEST=1 | ||
nosetests tests.core_tests:CoreTests.test_public_user_dashboard_access |
Oops, something went wrong.