Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable a specific group from dashboard and filter shares?

Cloud Services February 8, 2022

In the past we have used an updated version of the scripts located in this thread:

https://community.atlassian.com/t5/Jira-questions/Disable-share-quot-Any-Logged-in-User-quot/qaq-p/734667

to specifically prevent a group from being displayed on screen - i.e. the group that effectively means 'all logged in users'.

We did this using the following in our site Banner:

 

<script type='text/javascript'>
// ** DO NOT REMOVE THE FOLLOWING JAVA SCRIPT AS IT IS REQUIRED FOR FILTER, BOARD AND DASHBOARD NAMES TO BE PRIVATE TO THE INTENDED USERS **
// Disables 'Everyone', 'Logged in Users' and the group of 'jira-users' options 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);
});

//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);
});

//Check url for dashboard create
if (urlPath.toLowerCase().indexOf("addportalpage") >= 0){
intervalID = window.setInterval(callBack, 10);
}

// Removes unwanted elements
function callBack()
{
var loggedin = AJS.$("#share_type_selector_viewers option[value='loggedin']");
var jirausers2 = AJS.$("#groupShare option[value='jira-users']");
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");
}
if (jirausers2.length > 0) {
clearInterval(intervalID);
jirausers2.remove();
warning.remove();
addGlobal.remove();
desc.remove();
groupShare.removeAttr("style");
}
}

});

</script>

 

However, this stopped working when we upgraded to 8.13 - the code works in-so-far as it still removes the 'any logged in users' item - but the removal of the group 'jira-users' no longer works.

Has there been some change in the way the field containing the listed groups is named which would therefore require an upgrade? 

0 answers

Suggest an answer

Log in or Sign up to answer