/** * The client CAN use the information contained in * $response['manage_permission'] to make decisions such as whether or not to * allow the current user to edit the set of groups in the store. * @param Array $params Client input parameters * @return $response for the client. */ protected function actionSelectedStore($params) { $currentPermissionLevel = \GO\Base\Model\Acl::getUserPermissionLevel($params['model_id'], \GO::user()->id); $response['manage_permission'] = $params['currentUserHasManagePermission'] = \GO\Base\Model\Acl::hasPermission($currentPermissionLevel, \GO\Base\Model\Acl::MANAGE_PERMISSION); $response = array_merge($response, parent::actionSelectedStore($params)); return $response; }
protected function formatColumns(\GO\Base\Data\ColumnModel $cm) { $cm->formatColumn('username', '$model->user->username'); return parent::formatColumns($cm); }
protected function actionSelectNewStore($params) { if (\GO::user()->isAdmin()) { \GO::config()->limit_usersearch = 0; } // echo \GO::config()->limit_usersearch; // Check for the value "limit_usersearch" in the group-office config file and then add the limit. if (!empty(\GO::config()->limit_usersearch)) { if ($params['limit'] > \GO::config()->limit_usersearch) { $params['limit'] = \GO::config()->limit_usersearch; } $params['start'] = isset($params['start']) ? $params['start'] : 0; if ($params['start'] + $params['limit'] > \GO::config()->limit_usersearch) { $params['start'] = 0; } } $response = parent::actionSelectNewStore($params); if (!empty(\GO::config()->limit_usersearch) && $response['total'] > \GO::config()->limit_usersearch) { $response['total'] = \GO::config()->limit_usersearch; } return $response; }