OpenVeo Core server

API Docs for: 7.0.0
Show:

MenuController

Extends Controller
Module: core-controllers

Summary

Defines a controller to handle requests relative to the back end menu.

Constructor

MenuController

Syntax

MenuController

()

Summary

Item Index

Methods

filterMenuByPermissions

Syntax

filterMenuByPermissions

(
  • menu
  • user
)
private static

Summary

Filters the given menu depending on user permissions and requested menu items permissions.

Parameters:

  • menu Array

    The menu to filter

  • user Object

    The authenticated user

getMenuAction

Syntax

getMenuAction

(
  • request
  • response
  • next
)

Summary

Gets the backend menu as a JSON object.

If menu is empty a 404 Not Found is sent. Menu is filtered regarding user permissions.

Parameters:

  • request Request

    ExpressJS HTTP Request

    • user Object

      The connected user

      • id String
        The connected user id
  • response Response

    ExpressJS HTTP Response

  • next Function

    Function to defer execution to the next registered middleware

isAuthorized

Syntax

isAuthorized

(
  • user
  • permission
)
private static

Summary

Checks if user has the given permission.

Parameters:

  • user Object

    The user to test

    • permissions Array

      The user's permissions

  • permission String

    The permission id to check