Hi there,

The OG Field Access Module provides the functionality to set permissions for Edit/View, but does not allow Permissions to be set on Creation of Fields. Given that sometimes we want to allow certain roles to create fields, and perhaps others to edit them, this is needed functionality.

I have attached a Patch of a working version of these additions.

I'v commented the code as best I can to show what I'v changed.

Please consider adding this feature request to the next Dev Release.

Also, I renamed the Descriptions of the Permissions to just show the bundle, as the previous description didn't provide much insight into what it was for. Having the Bundle available is useful to those of us with multiple (but not shared) "Full name" fields (as an example) on different Bundles. I want to know that I am setting the permissions for the right Bundle.

Comments

Gemma Morton’s picture

Status: Active » Needs review

Hi.

Please review this patch, and let me know if it is committed into the latest dev release.

Thanks.

Gemma Morton’s picture

*bump*

This is critical for most projects, and I would appreciate a reply.

Gemma Morton’s picture

StatusFileSize
new3.36 KB

Attached a new patch that works with the latest DEV release

amitaibu’s picture

Project: Organic Groups » Organic Groups create permissions
Component: og-field-access » Code

This doesn't belong to OG core.

mrfelton’s picture

Status: Needs review » Needs work

This clearly needs work, as the patch above was aimed at the og_field_access module, and the maintainer of that module has bumped over to this module as he doesn't feel it's well suited over there. Personally, I'm not so sure.

@Amitaibu - why should og_field_access only provide partial support for field level access? Isn't a field level create permission part of field access in general?

amitaibu’s picture

> why should og_field_access only provide partial support for field level access?

As I've stated before, I'm willing to move the functionality og_create_perms to OG suite, provided someone writes a proper patch with tests.
Until that happens, this functionality should live in contrib.

mrfelton’s picture

@Amitaibu - Ok, that's good to know. But my point was that the field level create permissions should surely live in og_field_access, and not in og_create_perms - which is about node level access permissions - regardless of wether or not og_crete_perms becomes a part of OG core.

amitaibu’s picture

From http://api.drupal.org/api/drupal/modules--field--field.api.php/function/... :

$op The operation to be performed. Possible values: 'edit', 'view'.

There's nothing about create in the field level. So re-looking on the patch, I don't understand how it's possible.

mrfelton’s picture

The Field Permissions module provides global level field create permissions. I suspect the inspiration came from there

amitaibu’s picture

I understand. Ok, as stated above, if this patch is properly coded and includes test, it has bigger chance to get inside OG... :)