Files
gerrit/Documentation/pg-plugin-admin-api.txt
Thomas Draebing 7880b0bc64 Add capability check when adding plugin entries to admin nav
So far, when adding entries for plugins to the admin navigation, they
were always visible for all logged in users. In some cases, this might
not be desirable.

This change adds an optional parameter to the AdminApi().addMenuLink()
API for plugins, that allows to set a capability a user must have to see
the menu entry. If no capability is set, the menu entry will be visible
to all logged in users as before.

Change-Id: I463d6ec8b9fcf360318255f7785bdf8cc52b00bb
2019-09-06 02:09:48 +00:00

17 lines
637 B
Plaintext

= Gerrit Code Review - Admin customization API
This API is provided by link:pg-plugin-dev.html#plugin-admin[plugin.admin()]
and provides customization of the admin menu.
== addMenuLink
`adminApi.addMenuLink(text, url, opt_external, opt_capabilities)`
Add a new link to the end of the admin navigation menu.
.Params
- *text* String text to appear in the link.
- *url* String of the destination URL for the link.
When adding an external link, the URL provided should be a full URL. Otherwise,
a non-external link should be relative beginning with a slash. For example, to
create a link to open changes, use the value `/q/status:open`.