Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-65962

Option to disable "Any logged in user" permission

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Unresolved
    • None
    • None
    • None
    • 8
    • 2
    • We collect Jira feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.

      Regarding the implementation of the "Any logged in user" per JRASERVER-23255, some customers would like to have an option to disable the functionality entirely.

      Workaround

      This workaround was added to the following Atlassian Community post.

      Important Note

       Small mistakes in scripts added to the Announcement banner can cause major problems. We suggest following best practices for change management and evaluating any changes that may impact users in a staging instance before completing the changes in a production environment.

      1. Choose    > System
      2. Select User Interface > Announcement banner in the System panel below.
      3. Enter the required text in the Announcement field:
      For Jira 7.12.x and later:

      <script type='text/javascript'>
      
      // To use just place in JIRA Announcement Banner
      // Disables 'Any Logged in user' option when sharing filters AND dashboards
      // Fires on page load
      // Last tested for Jira 7.12.1 - 8.2.3
      
      AJS.toInit(function()
      {
      // Scrapes URL path 
      var urlPath = $(location).attr('pathname');
      // Sets variable for later use to disable checking for tag presence
      var intervalID;
      
      // check url if we are editing a filter 
      if (urlPath.toLowerCase().indexOf("editfilter") >= 0){
      intervalID = window.setInterval(callBack, 10);
      }
      // Listens for edit filter dialog
      AJS.$(".edit-filter").click(function() {
      intervalID = window.setInterval(callBack, 10);
      })
      
      //check url for dashboard edit
      if (urlPath.toLowerCase().indexOf("editportalpage") >= 0){
      intervalID = window.setInterval(callBack, 10);
      }
      // Listens for edit dashboard dialog
      AJS.$(".edit-dashboard").click(function() {
      intervalID = window.setInterval(callBack, 10);
      });
      
      // Removes unwanted elements
      function callBack() 
      {
      var loggedin = AJS.$("#share_type_selector_viewers option[value='loggedin']");
      var warning = AJS.$("#share_warning");
      var addGlobal = AJS.$("#share_add_global");
      var desc = AJS.$("#share_type_description");
      var groupShare = AJS.$("#share_group");
      
      if (loggedin.length > 0) {
      clearInterval(intervalID);
      loggedin.remove();
      warning.remove();
      addGlobal.remove();
      desc.remove();
      groupShare.removeAttr("style");
      }
      }
      });
      </script>
      

      For Jira 7.11.x and earlier:

      <script type='text/javascript'>
      
      // To use just place in JIRA Announcement Banner
      // Disables 'Any Logged in user' option when sharing filters AND dashboards
      // Fires on page load
      
      AJS.toInit(function()
      {
          // Scrapes URL path    
          var urlPath = $(location).attr('pathname');
          // Sets variable for later use to disable checking for tag presence
          var intervalID;
      
          // check url if we are editing a filter 
          if (urlPath.toLowerCase().indexOf("editfilter") >= 0){
              intervalID = window.setInterval(callBack, 10);
          }
          // Listens for edit filter dialog
          AJS.$(".edit-filter").click(function() {
              intervalID = window.setInterval(callBack, 10);
          })
      
          //check url for dashboard edit
          if (urlPath.toLowerCase().indexOf("editportalpage") >= 0){
              intervalID = window.setInterval(callBack, 10);
          }
          // Listens for edit dashboard dialog
          AJS.$(".edit-dashboard").click(function() {
              intervalID = window.setInterval(callBack, 10);
          });
      
          // Removes unwanted elements
          function callBack() 
          {
              var loggedin = AJS.$("#share_type_selector option[value='loggedin']");
              var warning = AJS.$("#share_warning");
              var addGlobal = AJS.$("#share_add_global");
              var desc = AJS.$("#share_type_description");
              var groupShare = AJS.$("#share_group");
      
              if (loggedin.length > 0) {
              clearInterval(intervalID);
              loggedin.remove();
              warning.remove();
              addGlobal.remove();
              desc.remove();
              groupShare.removeAttr("style");
              }
          }
      });
      </script>
      

      4. Select the required Visibility Level for the banner.
      5. Click the Set Banner button.
      6. Verify that the "Any Logged-In User" option is hidden from dashboard and filters.

       

      Another alternative — also unsupported by Atlassian and provided only AS-IS — is using just the style tag in the Announcement Banner:

      <!-- Custom CSS to hide the "Logged in" option when sharing Filters and Dashboards (JRASERVER-65962) -->
      <style>
      #share_type_selector_viewers > option[value="loggedin"] {
        display: none;
      }
      </style>
      

      Please read of the caveats and tradeoffs of such customizations on How to customize Jira with JavaScript and CSS.

              Unassigned Unassigned
              bpicarelli Benito Picarelli
              Votes:
              30 Vote for this issue
              Watchers:
              18 Start watching this issue

                Created:
                Updated: