x x x
Only portrait mode is currently supported - please rotate your device.

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Hide If
groupconfluence-administrators


Show If
groupcountry-admins


HTML
<div id="edit-style-container"> </div>

<script>

const countryAdminGroup = getQueryVariableFromUrl("cc") + "-admins";
var adminCanEdit = false;

async function checkIfCountryAdmin = async () => {
    let groupsRes = await jQuery.ajax({
      url: "/rest/api/user/memberof?username=" + AJS.params.remoteUser,
      type: "get",
      dataType: "json"
    }).then(res => res.results);

    console.log(groupsRes);

    for (let i = 0; i < groupsRes.length; i++) {
      let groupName = groupsRes[i].name;
      if (groupName === countryAdminGroup) {
         adminCanEdit = true;
      }
    }
	
	return true;
}

checkIfCountryAdmin().then(res => {
	if (!adminCanEdit) {
		document.getElementById("edit-style-container").innerHTML = (`<style> 
	.micropost .micropost-right .micropost-header .micropost-action-menu.show-permanent {
		display: none !important;
	}
 </style>`);
	}
});

</script>



...