Hello, I need to know if we have the possibility to hide the main menu of Jira before the user logs in.
I wish the Dashboard menu was not displayed before Login.
It's possible?
Tks.
Hy @Luiz Ricardo Pereira da Silva
You can add some javascript on the announcement banner and check if the user is login and if's not hide the banner.
You can check some info here: https://confluence.atlassian.com/adminjiraserver073/configuring-an-announcement-banner-861253135.html
You can view the code to check if a user is logedin here:
And to hide the banner: $(".aui-header").hide()
This isn't totally advised because they don't guarantee that is upgrade safe.
Best regards,
Pedro Felgueiras
I would use javascript in the announcement banner to hide the div. e.g to hide the announcement bannner if the user is not logged in.
Announcements
<script type="text/javascript">
function currentUserName() {
return AJS.params.loggedInUser;
}
var user=currentUserName();
if (user.lengeth==0))
AJS.$("#announcement-banner").hide();
</script>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've tried that script in my announcement banner and it doesn't appear to work.
I checked the content of user and it is undefined whether a user is logged in or not.
Is some extra setting or add-on required for these variables to be initialised?
Kind regards,
Kim.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No. Open the console and see if
AJS.params.loggedInUser
gives you the username of the logged in user. If it does not return anything than you need to explore
$authcontext.loggedInUser.name
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.