Hi.
I am happy I have found your module, but it seems a bit overkill for my use case.
The site I am working on has around 20 or more content types. You can imagine how many checkboxes that is in the permissions page, for "override node options".

What I really need is just simple permissions that work across content types.
Would it be possible to have a simple version of the module included in the package? This way, people could decide to either enable the simple version, or the full version.

Or even better:
Let people enable both modules (per-type and not-per-type) to give some roles "global" permissions, and grant "per-type" access for other roles.

For the sake of backwards compatibility, the existing module would become the "per-type" one, whereas the "not-per-type" would get a new module name.

Why 2 modules?
Because sometimes I really only want the not-per-type version.

Comments

webflo’s picture

It should be possible to add some global permissions e.g. "override published option for all content-types". We dont need two modules. Backwards compatibility is no problem.

geek-merlin’s picture

Title: Simple version, without "per content type" permissions? » permissions for "all content types"
Status: Active » Needs review
StatusFileSize
new3.92 KB

right. patch in the air.

simoneb’s picture

any news about this one ? does the patch work ?

geek-merlin’s picture

i'm using it all the time.
if you like it, test it and set to "reviewed", such is the game.

gpk’s picture

Status: Needs review » Needs work

This module with this patch looks like just what I need. Hope to be able to test it properly soon.

After a quick eyeball patch looks good functionally but doesn't conform to Drupal coding style.

// special permission "all node types"
should be something like
// Global permissions which apply to all node types.
if(!$name) $name = node_type_get_name($type);
should be

if (!$name) {
  $name = node_type_get_name($type);
}

Also not sure if using a key such as "___all___" is entirely kosher though I can see it would work! May be fine though. Will have a think/look.

Presumably having a global permission for an option overrides any "missing" checkbox for that option for a given node type (slightly hard to explain that clearly). i.e. permissions are additive as usual. This probably needs to be stated somewhere, maybe README.txt.

Personally I don't want the per node type permissions at all, but adding an option to only display the global permissions, or only the per node type permissions, is rather more work in terms of UI and making sure it works well when such a setting is changed so I won't suggest adding that at this stage, partly given the apparent limited interest in having the global permissions in the first place, though I suspect quite a few people are "managing" simply by ticking loads of checkboxes and would actually find global permissions useful.

opdavies’s picture

Issue summary: View changes
Issue tags: +Needs reroll

The patch in #2 no longer applies, so needs re-rolling against the latest 7.x-1.x version of ONO.

jenlampton’s picture

Status: Needs work » Needs review
StatusFileSize
new5.43 KB

Here's a reroll of the patch from #2 with a few slight changes. I didn't like the use of the __all__ token, so I just made a set of separate permissions.

jenlampton’s picture

Since in the original issue, @donquixote mentions that he did not want all the permissions Override Node Options module provided, I also went one step further and added a settings form so that admins could decide if they needed all the granular permissions, or not. Changing the type of permissions offered wipes all the previous permissions set (if necessary), and prompts admins to return to the permissions matrix to double check on access.

Status: Needs review » Needs work
jenlampton’s picture

Status: Needs work » Needs review
StatusFileSize
new10.13 KB

Sorry, that last patch was just the changes since the previous, hence the fail. This one is the complete set.

jenlampton’s picture

This one doesn't forget the global comment setting.

jenlampton’s picture

Here's one with smarter messaging around permissions granularity changes.

opdavies’s picture

Noticed a backdrop_set_message() in the last patch. ;)

opdavies’s picture

Status: Needs review » Needs work
Issue tags: -Needs reroll +Needs tests
opdavies’s picture

Issue tags: +Needs reroll

error: patch failed: override_node_options.module:10
error: override_node_options.module: patch does not apply

opdavies’s picture

opdavies’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
StatusFileSize
new17.73 KB
new6.84 KB

Added tests for the new functionality, and added an extra permissions check for comments in override_node_options.module.

opdavies’s picture

StatusFileSize
new17.73 KB
new406 bytes

Replace backdrop_set_message() with drupal_set_message().

opdavies’s picture

StatusFileSize
new17.74 KB

Another re-roll.

opdavies’s picture

Assigned: Unassigned » opdavies
opdavies’s picture

Assigned: opdavies » Unassigned
Status: Needs review » Needs work
Issue tags: +Needs reroll
opdavies’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
opdavies’s picture

Status: Needs review » Reviewed & tested by the community
giupenni’s picture

#19 works for me.

  • opdavies committed 1882955 on 7.x-1.x
    Issue #974730 by jenlampton, opdavies, axel.rutz, giupenni, gpk:...
opdavies’s picture

Version: 7.x-1.x-dev » 8.x-2.x-dev
Status: Reviewed & tested by the community » Needs work

Committed to 7.x-1.x. Thanks everyone!

I'll add a separate commit to clean up some coding standards issues that Drupal CI has flagged, and moving this to 8.x-2.x.

  • opdavies committed 7531964 on 8.x-2.x
    Merge branch 'permissions-for-all-content-types-974730' into 8.x-2.x...
opdavies’s picture

Status: Needs work » Fixed

Added to 8.x-2.x now too.

Status: Fixed » Closed (fixed)

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