Goal: To hide the 'Send subscriptions notifications' checkbox when editing or creating a node.

On admin/config/system/subscriptions, under Content Settings, I have:

  • selected all content types listed under 'Unlisted content types'
  • selected all content types listed under 'Blocked content types'
  • selected all content types listed under 'Static content types'

The user only has the 'Subscribe to content' permission and no others for the subscription module.

And yet, when a user goes to create a new node of any content type, at the bottom is the checkbox for 'Send subscriptions notifications'. What am I missing to hide the 'Send subscriptions notifications' checkbox??

Thanks.

Comments

rajmataj created an issue. See original summary.

salvis’s picture

Status: Active » Fixed

You are confused about how things fit together.

The 'Send subscriptions notifications' checkbox is completely unrelated to subscribing.

It is part of the 'Publishing options' tab (along with 'Published', 'Promoted to front page, and 'Sticky at top of lists') which is exposed only for users that have the 'administer nodes' permission. Normal users don't see that tab.

rajmataj’s picture

So, for anyone that can administer nodes, they will see this option no matter what. This tends to confuse a lot of my clients (working with a site that has about 100 'site owners' who can administer nodes and who, in turn, manage hundreds of less privileged editors, etc). I think I will create a custom module with a permission specifically designed to not render this control. Does this seem reasonable to bake into a future release?

Regardless, thanks for the clarification.

salvis’s picture

Does this seem reasonable to bake into a future release?

No, this is part of the fine-tuning that you need to implement yourself if your site has some very specific requirements.

I'd be surprised if you really did not need to have that option available though, even at the expense of having to educate your 'administer nodes' users.

Status: Fixed » Closed (fixed)

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

kyleheney’s picture

Status: Closed (fixed) » Active

Hi,

I am looking for a way to grant access to the Subscriptions options (under Publishing Options) for users that do not have the "Administer Content" permission. On our site, the "Administer Content" permission would open up way too many security holes, but I'd still like them to have the option to toggle Subscription notifications when editing their nodes.

I understand that some custom programming will be needed (sounds like using "hook_form_alter()" is needed). I have never needed to do this sort of thing on our site, so I'm looking for some assistance in how to make this happen. Basically, I'd like the "Send Subscription Notifications" to be visible for users of certain roles for certain content types.

Any help is very much appreciated.

scuba_fly’s picture

Version: 7.x-1.1 » 7.x-1.3
Category: Support request » Feature request

You could change line 502 of the subscriptions_content.module (version 1.3) to include an access check.

function subscriptions_content_form_alter(array &$form, array &$form_state, $form_id) {
  if (isset($form['type']['#value']) && $form['type']['#value'] . '_node_form' == $form_id && user_access('change subscriptions setting on node edit'))) {

And then you still need to create the permission.

If I find time in the future I'll create a patch for it.

Abelito’s picture

The least that the module should do, is hide this option (Send Subscription Notifications) for content types that are not available to subscribe to.

I'm also interested in this feature.

salvis’s picture

The least that the module should do, is hide this option (Send Subscription Notifications) for content types that are not available to subscribe to.

User 1 and additional roles (depending on permissions) can subscribe to all content types.

The people who see this option should know this...

Abelito’s picture

I see, so it is two conflicting Features.
Some people may want to keep that checkbox option for nodes that are not available to subscribe to, because permissions override the Subscription settings, and some roles may still be able to subscribe to all content types.

The clunky workaround is to use css to hide that option on the add/edit page for all content, and display it for specific content types.

salvis’s picture

Status: Active » Fixed

Either way, hook_form_alter() is the way to go here.

Status: Fixed » Closed (fixed)

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