A user_access check for the "sign up for content" permission exists inside of signup_sign_up_user() and is unnecessary, since access checking is a appropriately used in _signup_current_user_signup() to prevent the signup button from being displayed to the user if she lacks that permission.

The access check in signup_sign_up_user() disrupts functionality in a forthcoming signup companion module, which programmatically signs up users who are not allowed to do so directly.

This patch removes the unnecessary access check. I tested by enabling the signup form for display both in the node content as well as the signups tab, and granted a test user the "edit own signups" and "sign up for content" permissions. Both before and after this patch was applied, the signup form correctly disappeared when the user lacked the "sign up for content" permission.

Thanks!

CommentFileSizeAuthor
#4 480278.patch988 bytesezra-g
signup_access_check.patch725 bytesezra-g

Comments

dww’s picture

Status: Needs review » Needs work

Sounds reasonable, and the patch looks good. I'll probably commit this tomorrow. I just need to test it and look a bit closer.

One minor thing, can you update the docs in signup.api.php about this change?

Thanks!
-Derek

ezra-g’s picture

Sure -- Will do.

dww’s picture

I mean, update the PHPDoc in signup.module for signup_signup_up_user(). ;) This isn't a hook...

ezra-g’s picture

Status: Needs work » Needs review
StatusFileSize
new988 bytes

Attached patch adds warning text.

dozens’s picture

how do i install this module? it seems to be exactly what i need to set up a UC registration for a conference!

dww’s picture

@dozens: You need to wait until http://drupal.org/project/uc_signup has an official release. Until then, it's still under heavy construction. Please use the http://drupal.org/project/issues/uc_signup issue queue for support questions, not here. Thanks.

dww’s picture

Status: Needs review » Fixed

Gave this another look, tested a bit, and fixed the code style on the PHPDoc comment (needed a space between '*' and 'Caution'). Committed to HEAD and DRUPAL-6--1. This will be out in RC4.

Status: Fixed » Closed (fixed)

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