Is it possible to disable the share option "Any Logged-In User" from dashboard and filters?
I am using jira 7.3.3 version
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.
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,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, this works for filter and dashboard
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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"?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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'?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
<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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi folks!
Another alternative may be just through CSS in the Banner:
<style>
#share_type_selector_viewers > option[value="loggedin"] {
display: none;
}
</style>
(validated in Jira 9.11 but should work on many versions from 8 to 9)
Cheers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We did it as part of a plugin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
we are using Jira Software 8.13.7 , the script not helped any changes required ?
<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>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.