Please enable JavaScript to view this site.

The manual for the JobRouter developer

Navigation: Dashboard API > Methods and objects of the dashboard API > Overwritable methods

Authorization for a widget (isAuthorized)

Scroll Prev Top Next More

This function allows you to restrict the authorizations for the widget in addition to the categories. The method returns a boolean value, which decides whether the widget should be displayed for the respective user.

Example with the API-User object: Provide the widget only to specific users or Job Functions

public function isAuthorized()

{

    return $this->getUser()->getUsername() == 'admin' || $this->getUser()->isInJobFunction('development');

}