If a user is subscribed somewhere and then goes to his Profile -> Notifications -> Subscriptions and tries to hit the Delete button of the subscription entry you get access denied.

If you click Edit however and then Delete subscription it works fine.

"Maintain own subscriptions" is enabled for the role.

CommentFileSizeAuthor
#4 account.png26.26 KBarekanderu

Comments

karing’s picture

So let me know what modules exactly you're using.

For a basic D7 subscriptions install it's
My Account -> Subscriptions -> eg Pages/Threads so the URL is eg:

/user/1/subscriptions/node
On this Form there are checkboxes to turn a specific subscription on or off

arekanderu’s picture

I have all the Subscriptions modules enabled (except scheduler) + Messaging module and i am only using Content Type subscriptions and the delete button i am referring to is under user/UID/notifications/subscription. There is a list there with the active subscriptions and on the right of each list entry there is "edit" and "delete". Delete will cause the Access Denied.

karing’s picture

The "edit" "delete" buttons are not injected by subscriptions module (this project) but by the other modules you've enabled.

arekanderu’s picture

StatusFileSize
new26.26 KB

- please ignore

arekanderu’s picture

Status: Active » Closed (works as designed)
alex72rm’s picture

Issue summary: View changes

Dear both,

I haven't understood why have you closed this issue. I have exactly the same problem, only with registered user.

The link for delete is as follow:

http://<website_path>/notifications/subscription/<user_id>/delete?destination=user/<node_id>/notifications/subscription

It comes directly from "notifications" module.

Can you give me further advice to solve it?

Thank you!

salvis’s picture

The Notifications module was forked from Subscriptions years ago, but otherwise they are completely unrelated. You're in the wrong queue here.

alex72rm’s picture

I don't know if I'm right, but I've solved by myself.

From the notifications.module, in the function notifications_access_subscription I've modified slightly the code (added || user_access('manage own subscriptions')):

function notifications_access_subscription($subscription, $op = 'view', $account = NULL) {
  $account = $account ? $account : $GLOBALS['user'];
  if (user_access('administer notifications') || user_access('manage all subscriptions') || user_access('manage own subscriptions')) {
    return TRUE;
  }
  switch ($op) {
    case 'view':
      return $subscription->uid && ($subscription->uid == $account->uid);
    case 'edit':
    case 'unsubscribe':
      return $subscription->uid && ($subscription->uid == $account->uid) && user_access('maintain own subscriptions');
  }
  return FALSE;
}

It's working right now.

Sorry, I've noticed now that the module has been forked to "Subscriptions". I hope this solution could be useful indeed.