nifi-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (NIFI-375) New user role: Operator who can start and stop components
Date Fri, 14 Sep 2018 19:20:00 GMT

    [ https://issues.apache.org/jira/browse/NIFI-375?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16615268#comment-16615268
] 

ASF GitHub Bot commented on NIFI-375:
-------------------------------------

Github user mcgilman commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2990#discussion_r217816900
  
    --- Diff: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-settings.js
---
    @@ -1045,29 +1041,38 @@
             var reportingTaskActionFormatter = function (row, cell, value, columnDef, dataContext)
{
                 var markup = '';
     
    -            if (dataContext.permissions.canRead && dataContext.permissions.canWrite)
{
    -                if (dataContext.component.state === 'RUNNING') {
    +            var canWrite = dataContext.permissions.canWrite;
    +            var canRead = dataContext.permissions.canRead;
    +            var canOperate = dataContext.operatePermissions.canWrite || canWrite;
    +            var isStopped = dataContext.status.runStatus === 'STOPPED';
    +
    +            if (dataContext.status.runStatus === 'RUNNING') {
    +                if (canOperate) {
                         markup += '<div title="Stop" class="pointer stop-reporting-task
fa fa-stop"></div>';
    -                } else if (dataContext.component.state === 'STOPPED' || dataContext.component.state
=== 'DISABLED') {
    -                    markup += '<div title="Edit" class="pointer edit-reporting-task
fa fa-pencil"></div>';
    +                }
     
    -                    // support starting when stopped and no validation errors
    -                    if (dataContext.component.state === 'STOPPED' && nfCommon.isEmpty(dataContext.component.validationErrors))
{
    -                        markup += '<div title="Start" class="pointer start-reporting-task
fa fa-play"></div>';
    -                    }
    +            } else if (isStopped || dataContext.status.runStatus === 'DISABLED') {
     
    -                    if (dataContext.component.multipleVersionsAvailable === true) {
    -                        markup += '<div title="Change Version" class="pointer change-version-reporting-task
fa fa-exchange"></div>';
    -                    }
    +                if (canRead && canWrite) {
    +                    markup += '<div title="Edit" class="pointer edit-reporting-task
fa fa-pencil"></div>';
    +                }
     
    -                    if (nfCommon.canModifyController()) {
    -                        markup += '<div title="Remove" class="pointer delete-reporting-task
fa fa-trash"></div>';
    -                    }
    +                // support starting when stopped and no validation errors
    +                if (canOperate && dataContext.status.runStatus === 'STOPPED'
&& dataContext.status.validationStatus === 'VALID') {
    +                    markup += '<div title="Start" class="pointer start-reporting-task
fa fa-play"></div>';
                     }
     
    -                if (dataContext.component.persistsState === true) {
    -                    markup += '<div title="View State" class="pointer view-state-reporting-task
fa fa-tasks"></div>';
    +                if (canRead && canWrite && dataContext.component.multipleVersionsAvailable
=== true) {
    +                    markup += '<div title="Change Version" class="pointer change-version-reporting-task
fa fa-exchange"></div>';
                     }
    +
    +                if (nfCommon.canModifyController()) {
    --- End diff --
    
    Ah, I see what's changed. I was a little confused. The issue is that component removal
requires permissions to `WRITE` both the component in question and it's parent. With the changes
introduced here, we are no longer including `canWrite` when determining the visibility of
the delete icons.
    
    When I was reviewing, I was seeing the delete icon when I shouldn't have been. I only
had read and operate permissions to the component but the UI was presenting the delete icon
(because I still had write permissions to the parent). However, when I attempted to actually
delete it NiFi correctly told me I wasn't allowed.


> New user role: Operator who can start and stop components
> ---------------------------------------------------------
>
>                 Key: NIFI-375
>                 URL: https://issues.apache.org/jira/browse/NIFI-375
>             Project: Apache NiFi
>          Issue Type: New Feature
>          Components: Core Framework
>            Reporter: Daniel Ueberfluss
>            Assignee: Koji Kawamura
>            Priority: Major
>
> Would like to have a user role that allows a user to stop/start processors but perform
no other changes to the dataflow.
> This would allow users to address simple problems without providing full access to modifying
a data flow. 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message