public function users()
    {
        //Only admins and managers can access this controller
        if (!$this->Auth->isGroup(['admin', 'manager'])) {
            return;
        }

        $links[] = [__d('me_cms', 'List users'), [
            'controller' => 'Users',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];
        $links[] = [__d('me_cms', 'Add user'), [
            'controller' => 'Users',
            'action' => 'add',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        //Only admins can access these actions
        if ($this->Auth->isGroup('admin')) {
            $links[] = [__d('me_cms', 'List groups'), [
                'controller' => 'UsersGroups',
                'action' => 'index',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'Add group'), [
                'controller' => 'UsersGroups',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
        }

        return [$links, I18N_USERS, ['icon' => 'users']];
    }
public function users()
    {
        //Only admins and managers can access this controller
        if (!$this->Auth->isGroup(['admin', 'manager'])) {
            return;
        }

        $links[] = [__d('me_cms', 'List users'), [
            'controller' => 'Users',
            'action' => 'index',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];
        $links[] = [__d('me_cms', 'Add user'), [
            'controller' => 'Users',
            'action' => 'add',
            'plugin' => 'MeCms',
            'prefix' => ADMIN_PREFIX,
        ]];

        //Only admins can access these actions
        if ($this->Auth->isGroup('admin')) {
            $links[] = [__d('me_cms', 'List groups'), [
                'controller' => 'UsersGroups',
                'action' => 'index',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
            $links[] = [__d('me_cms', 'Add group'), [
                'controller' => 'UsersGroups',
                'action' => 'add',
                'plugin' => 'MeCms',
                'prefix' => ADMIN_PREFIX,
            ]];
        }

        return [$links, I18N_USERS, ['icon' => 'users']];
    }
public function users ( ) { //Only admins and managers can access this controller if ( ! $ this -> Auth -> isGroup ( [ 'admin' , 'manager' ] ) ) { return ; } $ links [ ] = [ __d ( 'me_cms' , 'List users' ) , [ 'controller' => 'Users' , 'action' => 'index' , 'plugin' => 'MeCms' , 'prefix' => ADMIN_PREFIX , ] ] ; $ links [ ] = [ __d ( 'me_cms' , 'Add user' ) , [ 'controller' => 'Users' , 'action' => 'add' , 'plugin' => 'MeCms' , 'prefix' => ADMIN_PREFIX , ] ] ; //Only admins can access these actions if ( $ this -> Auth -> isGroup ( 'admin' ) ) { $ links [ ] = [ __d ( 'me_cms' , 'List groups' ) , [ 'controller' => 'UsersGroups' , 'action' => 'index' , 'plugin' => 'MeCms' , 'prefix' => ADMIN_PREFIX , ] ] ; $ links [ ] = [ __d ( 'me_cms' , 'Add group' ) , [ 'controller' => 'UsersGroups' , 'action' => 'add' , 'plugin' => 'MeCms' , 'prefix' => ADMIN_PREFIX , ] ] ; } return [ $ links , I18N_USERS , [ 'icon' => 'users' ] ] ; }
Internal function to generate the menu for "users" actions
@return mixed Array with links, title and title options
Internal function to generate the menu for users actions