When I try to update the space content using the space administrator access it give me error "You must select one or more groups for this content."

it works fine with administrator access, please suggest.

CommentFileSizeAuthor
#22 OGSpacePermissions.png781.3 KBjoevagyok

Comments

Argus’s picture

Category: Support request » Bug report
Issue tags: -access permissions, -group

Could you write a step to step explanation to reproduce this?

dijup tuladhar’s picture

Login as authenticated member with administrator access for the space.
Edit the space and make some changes.

When you try to save the page it will give your the error.

mpotter’s picture

Confirmed this and added it to the list.

r0nn1ef’s picture

I was having this same issue and the only way that I could get rid of the error message was to set the "Administer Organic groups permissions" for authenticated users under the main Drupal permissions. I know this is a huge security hole if this has to be enabled, but maybe it will help track down where the "correct" organic groups permissions are off track.

Anonymous’s picture

This has been an issue for us too - I've come up with a simple workaround patch that seems to work:

diff --git a/profiles/openatrium/modules/contrib/og/og.module b/profiles/openatrium/modules/contrib/og/og.module
index db1d502..23eb9e3 100644
--- a/profiles/openatrium/modules/contrib/og/og.module
+++ b/profiles/openatrium/modules/contrib/og/og.module
@@ -751,6 +751,10 @@ function og_form_group_reference_validate($form, &$form_state) {
       // User has site-wide permissions to create or edit the node.
       return;
     }
+    if ($node->type == 'oa_space' && og_user_access('node', $id, 'update any oa_space content')) {
+      // User has permissions to update any oa_space content within the current Space
+      return;
+    }
   }
   elseif (entity_access($op, $entity_type, $entity, $account)) {
     // User has site-wide permissions to create or edit the entity.

This enables space members with 'Edit any Space content' permission to save changes to a Space without needing any additional Drupal permissions.

This is more of a quick workaround than a long term solution as it relies on introducing the concept of an OA Space into og.module.

mpotter’s picture

Status: Active » Postponed (maintainer needs more info)

This was an old issue that was resolved in a previous update (don't remember which version). In the latest version I can edit a space as the space admin without any errors. I can also edit a subspace without any errors.

The patch in #5 is definitely *not* recommended as you are patching OG with code that depends on Open Atrium 'oa_space'. Also, this patch would be a huge security issue. The "Edit any Space content" permission in OG refers to being able to edit spaces that you have ACCESS too. Not *any* space. Your above patch would allow a space admin to edit other spaces on your site, which defeats the purpose of limited space admins to their own space. The inherited access already allows the space admin of the parent to edit children spaces.

But if somebody can post a procedure to reproduce this in the latest version then I can take a look at it more.

Anonymous’s picture

Thanks for the feedback - yes, as mentioned definitely a quick and dirty (and back to front!) workaround rather than anything for a production environment.

We're currently running 7.x-2.22 - I'll see if this is still an issue once I've had a chance to upgrade to 2.24.

Brontolo’s picture

We have the same problem in Open Atrium 7.x-2.25

mpotter’s picture

You'll need to post the exact steps to reproduce this on a clean 2.25 install. I cannot reproduce this on any of our test systems here or on Pantheon.

gandhiano’s picture

Version: 7.x-2.13 » 7.x-2.26
Status: Postponed (maintainer needs more info) » Active

I get the same issue on the edition of spaces by space admins, using the latest OA stable. The problem does not happen if the user is a site administrator (I did not check exactly which permission setting allows it), just for normal authenticated users that are site admins.

Steps to reproduce:

  1. set an authenticated user as space administrator
  2. edit the space by this user
  3. try to save the space and get frustrated with the error message ;)
Argus’s picture

just for normal authenticated users that are site admins.

I suppose you mean "just for normal authenticated users that are Space admins"?

gandhiano’s picture

Yes, obviously ;)

Argus’s picture

Confirming, the user needs to have the Drupal right to "Edit any content" of the Space content type. By default this isn't enabled.

timdavison’s picture

I've had the same issue, and adding the permission 'edit any content' does allow the content to be saved.

However - any groups that were associated with the space are lost.

When an administrator edits the space page the inheritance 'tab' allows for parent groups to be selected. When an editor edits the space page this part of the inheritance tab is not present - and not only can the editor not edit the parent group(s) but the values already set for the parent groups are not saved.

I've tried adding other permissions to the editor role e.g. 'administer content' but I still can't get an editor to edit a space page without losing the groups.

mpotter’s picture

Status: Active » Postponed (maintainer needs more info)

There were issues with the OG Permissions in previous versions. Go to the Config/Organic Groups/Permissions/oa_space to see the default OG permissions and ensure the space Administrator role has all permissions checked in the Organic Groups section (where the "edit any content" permission is shown).

Also, please try updating to the 7.30-rc3 release since lots has been fixed since 2.26 so we can know if this is still an issue.

timdavison’s picture

Hi Mike - thanks for your quick reply.

Checking all permissions under Organic Groups/Permissions/oa_space made the 'parent' section of the inheritance tab show up, but there weren't any groups available to select. However if I also checked the administrator permissions under Organic Groups/Permissions/oa_group then all groups where I was an admin member were available for selection. (In both cases I think the key permission was 'Administer group'.)

That should allow me to do what I needed - so thanks again for your help.

mpotter’s picture

Status: Postponed (maintainer needs more info) » Fixed

OK, good to hear. The oa_adminrole module was supposed to set the admin permission for all of that automatically and that wasn't getting run as part of the installer. That's resolved in 7.30. So closing this issue and people can reopen this after 7.30 stable is released if it's still an issue.

Status: Fixed » Closed (fixed)

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

joevagyok’s picture

Version: 7.x-2.26 » 7.x-2.42
Status: Closed (fixed) » Active

I just did a fresh install.
I created a simple space, I created a user, and I added this user as administrator for that space.
I tried to edit the space and it gives the mentioned error.

This error comes only when you try to edit a space NOT sub-space.

Thanks

joevagyok’s picture

Title: Space page save error using space manager privilege » Space save error with "space admin" users
mpotter’s picture

Status: Active » Postponed (maintainer needs more info)

I just tried this on a fresh install and didn't have any problem, both locally or on Pantheon. Check your permission settings as described earlier in this thread. Or wait till the 2.43 release later today and test that. But if it's still an issue, give the exact steps to reproduce as well as a review of your permissions.

joevagyok’s picture

StatusFileSize
new781.3 KB

I still have this error with the new release as well.

  1. I downloaded the 2.43v
  2. Extracted the new files
  3. I did the installation on empty DB with "Quick install option"
  4. Created a private space and a simple user with admin account
  5. I added this user as member and after "Add as Admin"
  6. I logged in the user side and I edit the space and Click on Save, it is not saved.

I don't know how this difference is possible, but I did fresh install from zero, btw after the first admin login I receive some errors as well:

Warning: explode() expects parameter 2 to be string, array given in oa_tour_bootstrap_tour_alter() (line 56 of C:\xampp\htdocs\atrium\profiles\openatrium\modules\apps\oa_tour\oa_tour.module).
Warning: explode() expects parameter 2 to be string, array given in oa_tour_bootstrap_tour_alter() (line 56 of C:\xampp\htdocs\atrium\profiles\openatrium\modules\apps\oa_tour\oa_tour.module).
Warning: explode() expects parameter 2 to be string, array given in oa_tour_bootstrap_tour_alter() (line 56 of C:\xampp\htdocs\atrium\profiles\openatrium\modules\apps\oa_tour\oa_tour.module).
Warning: strpos() expects parameter 1 to be string, array given in drupal_parse_url() (line 584 of C:\xampp\htdocs\atrium\includes\common.inc).
Warning: explode() expects parameter 2 to be string, array given in drupal_parse_url() (line 586 of C:\xampp\htdocs\atrium\includes\common.inc).

I tried to do "fra -y" and all these common tweaks as well.

I give you my permission table from my OG Node Space Permissions in attachment.
I hope it helps!

Thank you

mpotter’s picture

Sorry, I missed your comment in #19 about Spaces vs Subspace.

To edit a top-level space in Atrium the user also needs to have the global Drupal permission to create/edit spaces. The "Edit Space" OG permission is for editing subspaces within a space. When editing a top-level space there isn't any OG permission for the parent (because there isn't any parent), so it uses the global Drupal permission.

I'll investigate if this can be improved or not in a future version cause I can see that this isn't really an ideal behavior. But right now that's how it works with saving a node with a Parent space field in Organic groups.

joevagyok’s picture

Okay, I found a compromise by giving permission to edit OWN Space content for the "auth user" role, so I just give authority for the root Space.
I don't see further security implication on other surrounding spaces on the platform by using this method.

BTW, that feature would be great, if you are a group admin, be able to edit the group itself as well.

Thank you

joevagyok’s picture

mpotter’s picture

Another workaround is to create a top-level Space and make all of your other spaces children of that single top level. Typically this is done on Atrium sites with the top-level space being the Home page of the site. Then you can assign Groups to the top-level space to give people admin access to the site, etc. Also makes it easy to customize the home page with the "Customize Page" and other space customizations.

Argus’s picture

Status: Postponed (maintainer needs more info) » Fixed

No reply after almost a year. Setting to fixed. Please reopen if needed.

Status: Fixed » Closed (fixed)

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