options['role'] . '_access_by_entity'; return $function('update group', 'node', 1, $account); } /** * Provide the access check as a callback. */ function get_access_callback() { $function = 'myaccessfunction_' . $this->options['role'] . '_access_by_entity'; return array($function, array('update group', 'node', 1)); } /** * Display for Views UI. */ function summary_title() { $choices = $this->options_choices(); $choice = $choices[$this->options['role']]; return $choice; } /** * Override of option_definition(). */ function option_definition() { $options = parent::option_definition(); $options['role'] = array('default' => 'manager'); return $options; } /** * Override of options_form(). */ function options_form(&$form, &$form_state) { $choices = $this->options_choices(); $form['role'] = array( '#type' => 'select', '#options' => $choices, '#title' => t('Roles'), '#default_value' => $this->options['role'], '#description' => t('Only users with the selected role will be able to access this display. Note that users with "access all views" can see any view, regardless of other permissions.'), ); } protected function options_choices() { $choices = array( 'owner' => t('Owner on property'), 'manager' => t('Manager on property'), 'lease_user' => t('Manager on lease'), ); return $choices; } }