Here is what I know to give you. Please let me know if you require more.

1. Using Organic Groups to Create a Project Management web app
2. I am creating a table that allows certain people to see that a project needs to be invoiced.
3. People with the OG Role "Project Manager" should be able to see an invoicable line item.
4. But a person with the OG Role "Project Helper" should NOT be able to see that line item.
5. I have the table built and it is showing invoicable projects to BOTH the Project Manager role --and-- the Project Helper role.
6, I have tried numerous contexts and relationships in the Advanced section of Views, but I'm not finding the combination that gets it working right. I've tried the "OG Roles" relationship, and that does not work. Perhaps I'm not doing something right with contexts.

Here is an export of my view settings.

/* Display: Project Invoicing Block */
$handler = $view->new_display('block', 'Project Invoicing Block', 'block_1');
$handler->display->display_options['display_description'] = 'Projects Sortable by Billing Status';
$handler->display->display_options['defaults']['use_ajax'] = FALSE;
$handler->display->display_options['use_ajax'] = TRUE;
$handler->display->display_options['defaults']['access'] = FALSE;
$handler->display->display_options['access']['type'] = 'perm';
$handler->display->display_options['defaults']['footer'] = FALSE;
$handler->display->display_options['defaults']['relationships'] = FALSE;
/* Relationship: OG membership: Group Node from OG membership */
$handler->display->display_options['relationships']['og_membership_related_node_group']['id'] = 'og_membership_related_node_group';
$handler->display->display_options['relationships']['og_membership_related_node_group']['table'] = 'og_membership';
$handler->display->display_options['relationships']['og_membership_related_node_group']['field'] = 'og_membership_related_node_group';
$handler->display->display_options['defaults']['fields'] = FALSE;
/* Field: Content: Title */
$handler->display->display_options['fields']['title']['id'] = 'title';
$handler->display->display_options['fields']['title']['table'] = 'node';
$handler->display->display_options['fields']['title']['field'] = 'title';
$handler->display->display_options['fields']['title']['relationship'] = 'og_membership_related_node_group';
$handler->display->display_options['fields']['title']['label'] = 'Project';
$handler->display->display_options['fields']['title']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['title']['hide_alter_empty'] = FALSE;
/* Field: Content: Body */
$handler->display->display_options['fields']['body']['id'] = 'body';
$handler->display->display_options['fields']['body']['table'] = 'field_data_body';
$handler->display->display_options['fields']['body']['field'] = 'body';
$handler->display->display_options['fields']['body']['relationship'] = 'og_membership_related_node_group';
$handler->display->display_options['fields']['body']['label'] = 'Description';
$handler->display->display_options['fields']['body']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['body']['hide_alter_empty'] = FALSE;
/* Field: Content: Project Dates */
$handler->display->display_options['fields']['field_project_dates']['id'] = 'field_project_dates';
$handler->display->display_options['fields']['field_project_dates']['table'] = 'field_data_field_project_dates';
$handler->display->display_options['fields']['field_project_dates']['field'] = 'field_project_dates';
$handler->display->display_options['fields']['field_project_dates']['relationship'] = 'og_membership_related_node_group';
$handler->display->display_options['fields']['field_project_dates']['label'] = 'Start';
$handler->display->display_options['fields']['field_project_dates']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_project_dates']['hide_alter_empty'] = FALSE;
$handler->display->display_options['fields']['field_project_dates']['settings'] = array(
  'format_type' => 'short',
  'fromto' => 'value',
  'multiple_number' => '',
  'multiple_from' => '',
  'multiple_to' => '',
  'show_repeat_rule' => 'show',
);
/* Field: Content: Project Dates */
$handler->display->display_options['fields']['field_project_dates_1']['id'] = 'field_project_dates_1';
$handler->display->display_options['fields']['field_project_dates_1']['table'] = 'field_data_field_project_dates';
$handler->display->display_options['fields']['field_project_dates_1']['field'] = 'field_project_dates';
$handler->display->display_options['fields']['field_project_dates_1']['relationship'] = 'og_membership_related_node_group';
$handler->display->display_options['fields']['field_project_dates_1']['label'] = 'End';
$handler->display->display_options['fields']['field_project_dates_1']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_project_dates_1']['hide_alter_empty'] = FALSE;
$handler->display->display_options['fields']['field_project_dates_1']['click_sort_column'] = 'value2';
$handler->display->display_options['fields']['field_project_dates_1']['settings'] = array(
  'format_type' => 'short',
  'fromto' => 'value2',
  'multiple_number' => '',
  'multiple_from' => '',
  'multiple_to' => '',
  'show_repeat_rule' => 'show',
);
/* Field: Content: Project Price (if applicable) */
$handler->display->display_options['fields']['field_project_price']['id'] = 'field_project_price';
$handler->display->display_options['fields']['field_project_price']['table'] = 'field_data_field_project_price';
$handler->display->display_options['fields']['field_project_price']['field'] = 'field_project_price';
$handler->display->display_options['fields']['field_project_price']['relationship'] = 'og_membership_related_node_group';
$handler->display->display_options['fields']['field_project_price']['label'] = 'price';
$handler->display->display_options['fields']['field_project_price']['element_label_colon'] = FALSE;
$handler->display->display_options['fields']['field_project_price']['settings'] = array(
  'thousand_separator' => ',',
  'decimal_separator' => '.',
  'scale' => '2',
  'prefix_suffix' => 1,
);
$handler->display->display_options['defaults']['arguments'] = FALSE;
/* Contextual filter: We pass the user ID as the Entity ID. */
$handler->display->display_options['arguments']['etid']['id'] = 'etid';
$handler->display->display_options['arguments']['etid']['table'] = 'og_membership';
$handler->display->display_options['arguments']['etid']['field'] = 'etid';
$handler->display->display_options['arguments']['etid']['ui_name'] = 'We pass the user ID as the Entity ID.';
$handler->display->display_options['arguments']['etid']['default_action'] = 'default';
$handler->display->display_options['arguments']['etid']['title_enable'] = TRUE;
$handler->display->display_options['arguments']['etid']['title'] = 'Your Projects';
$handler->display->display_options['arguments']['etid']['default_argument_type'] = 'current_user';
$handler->display->display_options['arguments']['etid']['summary']['number_of_records'] = '0';
$handler->display->display_options['arguments']['etid']['summary']['format'] = 'default_summary';
$handler->display->display_options['arguments']['etid']['summary_options']['items_per_page'] = '25';
$handler->display->display_options['arguments']['etid']['specify_validation'] = TRUE;
$handler->display->display_options['arguments']['etid']['validate']['type'] = 'user';
$handler->display->display_options['defaults']['filter_groups'] = FALSE;
$handler->display->display_options['defaults']['filters'] = FALSE;
/* Filter criterion: OG membership: State */
$handler->display->display_options['filters']['state']['id'] = 'state';
$handler->display->display_options['filters']['state']['table'] = 'og_membership';
$handler->display->display_options['filters']['state']['field'] = 'state';
$handler->display->display_options['filters']['state']['value'] = array(
  1 => '1',
);
$handler->display->display_options['filters']['state']['group'] = 1;
/* Filter criterion: Content: Published */
$handler->display->display_options['filters']['status']['id'] = 'status';
$handler->display->display_options['filters']['status']['table'] = 'node';
$handler->display->display_options['filters']['status']['field'] = 'status';
$handler->display->display_options['filters']['status']['relationship'] = 'og_membership_related_node_group';
$handler->display->display_options['filters']['status']['value'] = '1';
$handler->display->display_options['filters']['status']['group'] = 1;
/* Filter criterion: OG membership: Entity_type */
$handler->display->display_options['filters']['entity_type']['id'] = 'entity_type';
$handler->display->display_options['filters']['entity_type']['table'] = 'og_membership';
$handler->display->display_options['filters']['entity_type']['field'] = 'entity_type';
$handler->display->display_options['filters']['entity_type']['value'] = 'user';
$handler->display->display_options['filters']['entity_type']['group'] = 1;
/* Filter criterion: Content: Billing (field_billing) */
$handler->display->display_options['filters']['field_billing_value']['id'] = 'field_billing_value';
$handler->display->display_options['filters']['field_billing_value']['table'] = 'field_data_field_billing';
$handler->display->display_options['filters']['field_billing_value']['field'] = 'field_billing_value';
$handler->display->display_options['filters']['field_billing_value']['relationship'] = 'og_membership_related_node_group';
$handler->display->display_options['filters']['field_billing_value']['value'] = array(
  'Needs Invoiced' => 'Needs Invoiced',
);
$handler->display->display_options['filters']['field_billing_value']['group'] = 1;
$handler->display->display_options['filters']['field_billing_value']['exposed'] = TRUE;
$handler->display->display_options['filters']['field_billing_value']['expose']['operator_id'] = 'field_billing_value_op';
$handler->display->display_options['filters']['field_billing_value']['expose']['label'] = 'Billing Status';
$handler->display->display_options['filters']['field_billing_value']['expose']['operator'] = 'field_billing_value_op';
$handler->display->display_options['filters']['field_billing_value']['expose']['identifier'] = 'field_billing_value';
$handler->display->display_options['filters']['field_billing_value']['expose']['multiple'] = TRUE;
$handler->display->display_options['filters']['field_billing_value']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  3 => 0,
);
/* Filter criterion: Content: Title */
$handler->display->display_options['filters']['title']['id'] = 'title';
$handler->display->display_options['filters']['title']['table'] = 'node';
$handler->display->display_options['filters']['title']['field'] = 'title';
$handler->display->display_options['filters']['title']['relationship'] = 'og_membership_related_node_group';
$handler->display->display_options['filters']['title']['operator'] = 'word';
$handler->display->display_options['filters']['title']['group'] = 1;
$handler->display->display_options['filters']['title']['exposed'] = TRUE;
$handler->display->display_options['filters']['title']['expose']['operator_id'] = 'title_op';
$handler->display->display_options['filters']['title']['expose']['label'] = 'Search Projects (by Nickname)';
$handler->display->display_options['filters']['title']['expose']['operator'] = 'title_op';
$handler->display->display_options['filters']['title']['expose']['identifier'] = 'title';
$handler->display->display_options['filters']['title']['expose']['remember_roles'] = array(
  2 => '2',
  1 => 0,
  3 => 0,
);
$handler->display->display_options['block_description'] = 'Project Invoicing Block';

Comments

wadmiraal’s picture

What do the lines in your table represent? Are they nodes? Fields on a specific node? (sorry, too lazy to scan through the Views export you provided)

If they are nodes, I imagine you have a node that acts as the invoice (maybe a custom content type)? If so, make sure Project Helpers have no access to it. OG allows you to give permissions (similar to Drupal core) in context of the group. Make sure the Project Helper cannot see the Invoice node.

If they are fields, it's a little trickier. You can check out stuff like Field Permissions, but that doesn't apply in context of groups, only the global site.

thomasaaron’s picture

The columns in my table are field types ... Project Name, Start Date, End Date, Billing Status, Pricing ... etc...
The rows are individual projects ... and individual tasks on a different table.

I've gotten it to work after a fashion by making visability of a task's invoicing status based on rights to view the project itself. That works, but my needs are a little trickier than that.

I'll look over what you wrote. I'm not super-good at this, so I usually have to digest it a bit.

But I AM starting to think that Organic Groups permissions are pretty flakey. It takes a lot of tweaking to get them working correctly, and they are not quite fine-tunable enough for me.

I might have a look at Drupal Commons to see if that is a better fit for me.

thomasaaron’s picture

I head somewhere that Drupal Commons had a fairly large number of patches to Organic Groups ... so maybe they have solved some of my dilemmas.