So I played with this and have been messing with the code and it looks like this works pretty good if the group is "public". But does this do much if the group is private?

I am looking to give users outside of a group access to a private post. This works with normal og but spaces_og blocks access.

The front page states "allows you to easily define the rules by which organic groups posts will be visible to non-group members" but from my testing it seems this is only if the group is public. Am I wrong and just a crappy tester :)?

Comments

that0n3guy’s picture

Ok, so after messing with this some more I think I found a simple solution to my problem.

I take the spaces "private" preset and make it so that it not actually "private' by unchecking "private group" here: admin/build/spaces/list/atrium_groups_private/edit (for Open Atrium for example).

Then I create a private policy that makes the groups nodes private to everyone but group members in a module ... something like:

/**
 * Implementation of hook_og_privacy_policy_info().
 */
function og_privacy_ctplus_og_privacy_policy_info($node) {
  $policies = array();
  $policies['og_privacy_ctplus_private_policy'] = array(
    'access callback' => 'og_privacy_ctplus_private_policy',
    'reason' => t('This group is private and can only be accessed by group members'),
  );
  return $policies;
}

function og_privacy_ctplus_private_policy($node) {
  return FALSE;
}

Then I could:
A. create other policies that allow other access to nodes
B. Just us other access control modules to grant access to nodes

It seems that this module allows me to have a private group, without og or spaces handling the permissions. Since spaces_og seems to take over an not allow other access modules to work with it, this is pretty sweet.

Is their anything wrong with doing this? Is their anything wrong w/ not letting spaces_og handle the access perms?

Grayside’s picture

So that's partially correct.

1. OG Privacy does nothing with a Private Group. All it controls is restricting node privacy within a public group. So if you wanted a publicly visible group with private content you would do something like your code example above.
2. OG Privacy uses OG's own node access implementation. All it does is override the privacy logic in OG & Spaces to provide its own.

What you do above would lock down all content, then as you say in (A), you could open up content based on other rules, such as identifying a particular content type that should be public.

You *cannot* combine other access control mechanisms with OG Privacy and expect it to work. Node Access modules don't really play nicely together. That said, anything which integrates with OG Access should have logic enough to interface with how you use OG Privacy.

that0n3guy’s picture

Status: Active » Closed (fixed)

Great, thanks! I'm going to mark this as closed since you answered my question.

I created a module with this thinking that you can checkout here: https://github.com/that0n3guy/og_privacy_ctplus

Thanks again.

socialnicheguru’s picture

Status: Closed (fixed) » Active

Can you add #2 to the project page? It would make it clearer.

socialnicheguru’s picture

#3, so for OG Privacy CTPlus allows a private group to have public content? what type of private group? members can request membership or membership strictly controlled by admin?

#2, so OG Privacy allows public groups to have private content?

Grayside’s picture

Status: Active » Fixed

@#5 Yes, private content in public groups.

@that0n3guy haven't had a chance yet to look at the code. I'll try to take a peek next time I have time for OG Privacy development.

socialnicheguru’s picture

@that0n3guy, will your module be on Drupal.org?

that0n3guy’s picture

No, just on github.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

socialnicheguru’s picture

Status: Closed (fixed) » Active

Hi,

I need a further clarification. sorry I am so dense.

og_privacy allows public groups to have private content. it only applies to public groups. I believe that is what you were referring to in #6/

OG Privacy CTPlus only applies to private groups. It can restrict content. it makes content not accessible even to other group members. You can make it accssible to other members outside the group by specifying their names.

Is there a module that allows private groups to have public content?

Grayside’s picture

Status: Active » Closed (won't fix)

The concept of a Private group is that it is completely locked down. There is no module that helps a private group publish public content because you would essentially have to rewrite og_access to account for the dramatically different use case. While I've seen the request for that a number of times in various places, it seems like a usability fail to me.

Regardless, I suggest you look into a publishing workflow of some kind that allows private groups to promote content to public. This might involve adding a custom access control layer (complex), or more simply setting up something where content is syndicated in a public way from the private group. (Node duplication by one means or another.)

OG Privacy itself is not the project to support that.