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!
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 480278.patch | 988 bytes | ezra-g |
| signup_access_check.patch | 725 bytes | ezra-g |
Comments
Comment #1
dwwSounds 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
Comment #2
ezra-g commentedSure -- Will do.
Comment #3
dwwI mean, update the PHPDoc in signup.module for signup_signup_up_user(). ;) This isn't a hook...
Comment #4
ezra-g commentedAttached patch adds warning text.
Comment #5
dozens commentedhow do i install this module? it seems to be exactly what i need to set up a UC registration for a conference!
Comment #6
dww@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.
Comment #7
dwwGave 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.