mirror of
https://github.com/valitydev/redash.git
synced 2024-11-07 01:25:16 +00:00
Merge pull request #2472 from tonyjiangh/fix/disable_view_only_fork
Disable fork button for view_only user
This commit is contained in:
commit
ee8f6c1c71
@ -11,6 +11,7 @@
|
||||
// The real magic ;)
|
||||
> a {
|
||||
pointer-events: none;
|
||||
color: @dropdown-link-disabled-color;
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,8 +30,6 @@
|
||||
|
||||
&:not([class*="bg-"]) {
|
||||
& > li > a {
|
||||
color: #4C4C4C;
|
||||
|
||||
&:hover {
|
||||
color: #000;
|
||||
}
|
||||
|
@ -58,7 +58,7 @@
|
||||
<span class="zmdi zmdi-more"></span>
|
||||
</button>
|
||||
<ul class="dropdown-menu pull-right" uib-dropdown-menu>
|
||||
<li><a ng-click="duplicateQuery()" ng-disabled="query.id === undefined || !canForkQuery()"> Fork</a></li>
|
||||
<li ng-class="{'disabled': query.id === undefined || !canForkQuery() }"><a ng-click="duplicateQuery()"> Fork</a></li>
|
||||
<li class="divider"></li>
|
||||
<li ng-if="!query.is_archived && query.id != undefined && (isQueryOwner || currentUser.hasPermission('admin'))"><a ng-click="archiveQuery()">Archive</a></li>
|
||||
<li ng-if="!query.is_archived && query.id != undefined && (isQueryOwner || currentUser.hasPermission('admin')) && showPermissionsControl"><a ng-click="showManagePermissionsModal()">Manage Permissions</a></li>
|
||||
|
@ -145,6 +145,8 @@ function QueryViewCtrl(
|
||||
|
||||
$scope.canExecuteQuery = () => currentUser.hasPermission('execute_query') && !$scope.dataSource.view_only;
|
||||
|
||||
$scope.canForkQuery = () => currentUser.hasPermission('edit_query') && !$scope.dataSource.view_only;
|
||||
|
||||
$scope.canScheduleQuery = currentUser.hasPermission('schedule_query');
|
||||
|
||||
if ($route.current.locals.dataSources) {
|
||||
|
Loading…
Reference in New Issue
Block a user