It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Disable share "Any Logged-in User"

Is it possible to disable the share option "Any Logged-In User" from dashboard and filters?
I am using jira 7.3.3 version

 

Share.png

2 answers

1 accepted

3 votes
Answer accepted

There is not a setting within Jira that you can set to disable this option.   However there is a KB on a related issue that provides a javascript that will allow you to hide an element in this view.  You can see more details on this in the KB: How to Remove the 'Everyone' Share Option from Filters.

 

While that KB is about removing the 'everyone' or public sharing option, we can alter the script on that page in order to also hide this 'Any logged-in user' option if you so desire.

To do this, you will need to be using Jira Server.  As Jira Cloud may not have the announcement banner any more going forward.   What I did was take the script on that page and then alter it to look like this:

 

<script type='text/javascript'>

// To use just place in JIRA Announcement Banner
// Disables 'Any logged-in user' option when sharing filters
// 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);
    });

    // 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>

When I posted this script into the announcement banner (set to public mode), then each time that page is loaded, you won't see the option to share the filter with that specific entity.  

That said this work-around might be helpful.  Something to note about this:  This only would prevent your web users of Jira from being able to do this.  It does not effect users that make calls to Jira using the REST API as a means to share filters.   In most cases, I don't expect that to be something commonly done via REST, but just to make you aware of how it could still be done even with this work-around.

Andy Heinzer Atlassian Team Feb 23, 2018

So after writing this up, I realized that this would only work on the filter edit dialog.  In your screenshot it was for the dashboard sharing, which technically has some different element names which would not work for that.  So I tweaked the script some more and I believe this one below will remove that option from both dashboards and filter edit screens:

<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>

 

Cheers,

Thanks, this works for filter and dashboard

This is really helpful for us as well, but I think we're going to need to do this as well, but what would be the easiest way to edit this to work for BOTH 'Everyone' and "Any logged in user"? 

Andy Heinzer Atlassian Team Apr 24, 2019

@Paul Benario What version of Jira are you using where you see both 'any logged in user' and everyone as an entity?  My understanding was that Jira would show you one or the other depending on your version of Jira.  But maybe I'm mistaken here.

Or are you asking how to remove everyone this ability from both filter and dashboards instead of the 'any logged in user'?

@Andy Heinzer we're on 7.5.0.

Sorry - I was wrong on the terminology. I mean removing both 'public' and 'any logged-in user' from the drop down. Screenshot kept failing to upload, but I can try again.

Is removing public just a system setting? 

Andy Heinzer Atlassian Team Apr 26, 2019

Hi Paul,

Yes the Public setting became a system option in Jira 7.2 and higher.  It's something you can find in the system settings under JIRA Admin > System > General Configuration > Edit Settings.  The setting is called 'Public sharing'.  From that description:

Allows users to share dashboards and filters with all users including those that are not logged in. Disabling this will not change sharing for dashboards and filters that are already shared with the public. See related knowledge base article.

So the public setting only affects users without a login account for Jira (aka anonymous users).   It's the 'Any Logged in user' role that can only really be hidden from end users via the scripts above.

I hope that helps to clarify here.

Andy

Like JEFF COULTER likes this

Hi Andy,

Try to use this script on Jira 8.02 - is not working. Added this to announcement banner,  go to the Issue--> manage filters-->my filters-->edit filter and i still see option "Any Logged in user". Any ideas? 

Andy Heinzer Atlassian Team Aug 07, 2019

Hi @Administrator 

Thanks for bringing this up.  It appears that the element name has changed since I first answered this post.  I think I know why now.  In Jira 7.12 Atlassian introduced some changes to the elements names here.  It was part of the enhancements made to filters to allow them to be shared out to other users more easily. More details in Jira 7.12 Release notes. Try this instead:

<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>

Thanks! Now it works great!

<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 create
if (urlPath.toLowerCase().indexOf("addportalpage") >= 0){
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>

 I've added "dashboard create" block, because you can find the same construction there as well.

Thanks - We're in the process of updating from 7.5.2 to 8.3.3 and just came across the same issue that the previously implemented workaround wasn't functioning in the newer version.

Updated as above and functionality is restored.

Can confirm it still works for Jira 8.3.3, if you wanted to update the script text.

We did it as part of a plugin. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira

Demo Den Ep. 7: New Jira Cloud Reports

Learn how to use two new reports for next-gen projects in Jira Cloud:  Cumulative flow diagram and Sprint burndown chart. Ivan Teong, Product Manager, Jira Software, demos the Cumulative ...

314 views 1 3
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you