This is a customization of the standard menu bar item that mixes in the ability to determine whether or not the current user has the ability to create content at the current rendered location. This was created for use in the document library (for items in the "Create..." menu but is applicable for use anywhere where user access rights need to be verified.
This function filters the menu item based on the supplied user access payload against the data in the "permission" attribute that should be set when the item is instantiated. This code is based on the "onUserAccess" function from the original YUI based DocumentLibrary "toolbar.js" widget.
Name Type Description
object The payload published on the filter topic
Extended to add additional subscription to listen for changes to the filter. If the filter is not set to a path then it is not possible to create content.