Skip to content

Commit

Permalink
fix(admin-ui): Set default requiresPermission for ActionBar items
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Jan 5, 2020
1 parent 1aea1b5 commit 292e6d4
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,10 @@ export class NavBuilderService {
* `data-location-id` attribute.
*/
addActionBarItem(config: ActionBarItem) {
this.addedActionBarItems.push(config);
this.addedActionBarItems.push({
requiresPermission: Permission.Authenticated,
...config,
});
}

getRouterLink(config: { routerLink?: RouterLinkDefinition }, route: ActivatedRoute): string[] | null {
Expand Down Expand Up @@ -104,7 +107,9 @@ export class NavBuilderService {
if (!section) {
// tslint:disable-next-line:no-console
console.error(
`Could not add menu item "${item.config.id}", section "${item.sectionId}" does not exist`,
`Could not add menu item "${item.config.id}", section "${
item.sectionId
}" does not exist`,
);
} else {
const index = section.items.findIndex(i => i.id === item.before);
Expand Down

0 comments on commit 292e6d4

Please sign in to comment.