1

I have added a script editor web part in SP 2013 to add the code below to place a status message at the top but it doesn't work for non-admin users.

I can see it just fine logged in as the admin on any computer but not as regular users. I know in the past I would have to publish a major version of a page to get the changes to display but I don't know how to do this for a web part.

I've published the master page as a major version and the home.aspx has been checked out/in but still nothing.

I found that if I elevate the end users to Contribute level from Read then they can view the message bar.

Is there something I'm missing here?

<script language="javascript" type="text/javascript">
var statusID = ' ';
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', AddStatusMethod);
function AddStatusMethod()
{
    this.statusId = SP.UI.Status.addStatus("NewsFlash", "New Message");
    SP.UI.Status.setStatusPriColor(this.statusId, "yellow");
}
</script>
  • Have you published the home.aspx page? – Ransher Singh May 7 '15 at 17:45
  • Yes I have. It's a wiki page so I think each version is a major version. – DougS May 7 '15 at 18:03
  • Robert, I've tried it using the executeFunc vs ExecuteOrDelayUntilScriptLoaded but have found that executeFunc doesn't load on initial page load but the other does. I've found that it's some kind of permissioning issue. If I change the users permission level from Read to Contribute or higher, they can see the status bar. Trying to figure out why. – DougS May 7 '15 at 18:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.