Node Access Keys is for Drupal 7.
Node Access Keys helps to grant users temporary view permissions to selected content types on a per user role basis. You can have multiple Access Keys for different content types and user roles.
As an example, this module could be used on a registration site that requires content to be hidden from a non-registrant but visible to users who have registered (not registered through the core user module, I mean register as in submitting a Webform or something). An Access Key could be emailed to them which would grant them view permission to the content types specified. This makes it so users are not required to have individual user accounts.
http://drupal.org/sandbox/danielkorte/1264754
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/danielkorte/1264754.git nodeaccesskeys
Comments
Comment #0.0
daniel korteFixed git clone line
Comment #1
daniel korteI added a .test file that tests all parts of this module.
Comment #2
klausi* git release branch missing, see http://drupal.org/node/1015226
* remove LICENSE.txt, it is added automatically by drupal.org packaging
* nodeaccesskeys_edit(): doc block @param description indentation is only one space, should be 2. See http://drupal.org/node/1354#functions
* nodeaccesskeys_install(): not need to initialize variables here, variable_get() makes use of default values anyway. Remove the whole function.
Otherwise the code looks very good, seems nearly ready.
Comment #3
daniel korteThank you for your review.
* 7.x-1.x release branch added.
* removed LICENSE.txt
* Fixed @param indentations throughout.
* I'm not sure if I follow, are you suggesting that I set this variable elsewhere? If so, where? Please explain.
Comment #4
daniel korteViews integration and settings page added.
Comment #5
daniel korteOkay, two things:
I realize
variable_get()makes use of default values but my intention is not to get the 'site_403' variable. My intention is to set the 403 page so that my module can present the user with a form granting view access to content (provided that they have the access key) whenever they attempt to view a page that is protected by this module.Anyways, this module is being used on a live web site rolling out this Monday. I can email someone the development site (with an access key) to see it in use. Just ask.
Sooo.... anyone want to bump me out of sandbox mode??? ;)
Comment #5.0
daniel korteFixed git clone line again!
Comment #6
daniel korteComment #7
patrickd commentedPlease fix all code formatting issues, we'll get back to you soon.
Review of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.
If you got questions on this, please ask!
Comment #8
daniel korteAll code cleaning has been completed.
4 errors remain because the Views api classes don't follow the lowerCamel format.
Comment #9
daniel korteI'm marking this fixed because it is ready to boot.
Comment #10
patrickd commentedThere was no manual in-depth review yet.
Please read the documentation about the application workflow: http://drupal.org/node/539608
Comment #11
daniel korteOh shucks. My bad.
Comment #12
misc commentedDid a manual review of the code, and everything looks okay (as what I know...).
Installed the module, without problems. The setup was easy and the functionality no problem. Thumbs up from here. And a really useful module.
Comment #13
daniel korteYay! Thanks MiSc! Yeah, I couldn't believe that this module didn't exist already.
Comment #14
klausimanual review:
$output = '<ul>';": use theme('item_list', ...) instead.Get a review bonus and we will come back to your application sooner.
Comment #15
daniel korteThank you klausi! I've made the changes though through my testing it appears that I still have to serialize/unserialize my nodetypes and roles columns even though I've changed the schema to use
'serialize' => TRUE. I'm not sure if I'm missing something but after looking at other modules it appears they also serialize/unserialize when selecting/inserting into the DB...Comment #16
prashantgoel commentedplease visit http://ventral.org/pareview/httpgitdrupalorgsandboxdanielkorte1264754git for the seeing and correcting the list of errors being generated.
Comment #17
patrickd commenteddon't set needs work if there are only so few and minor issues found.
Comment #18
daniel korteFixed the issues that I could. The four errors remaining can't be fixed because the function names being overridden are dictated by the Views module.
Comment #19
scot.hubbard commentedHi Daniel,
I have just completed a review of your module and can't find anything major. I can confirm that points raised by klausi have been picked up.
There are no licensing issues as there is no third party code involved.
One suggestion would be to add the configure parameter to your .info file (I know you have a message that appears once the user has enabled the module, but adding the configure link would mean that there is a persisent link to the module's admin page from the admin/modules/list page too).
The module installed and uninstalled cleanly.
Setting to RTBC.
Comment #20
scot.hubbard commentedOops - didn't change the status.
Comment #21
daniel korteThanks Scot! I added the configure parameter. I appreciate the suggestion and your review.
Comment #22
patrickd commentedComment #23
patrickd commentedgot to go, will continue later
Comment #23.0
patrickd commentedClarified 'registered'
Comment #24
patrickd commentedComment #25
patrickd commentedPlease add installation and usage instructions to your project page, also see tips for a great project page.
filter_xss_admin($message): filter_xss() not necessary your just printing out static text, no user values contained - (but better too many filters then too few)return t($this->options['node_type']);don't put variables into t() only strings (t('translate me')) are translatable, also content types are "already translated" as the user enters them$form['accesskey']['#default_value'] = check_plain($record->accesskey)also here's check_plain not necessary - #default_values are check_plain()ed automaticallyIt seems to me that your often not sure whether you should filter a value or not.
Think about..
1. Does this value come from outside? (User input, Browser data, etc)
-> Yes, save dirty - output with checkplain()
-> No, it's static text in my own source - just print it out
On the other site the are often functions / API's in drupal that already filter for you - therefore you got to pass the raw value to it and eg. the forms api will check_plain() itself.
After some time you will know what to filter or not automatically, until then - find it out by testing:
just replace the variable with eg.
xyx">and search the page dom for xyxif it was escaped automatically it should be
xyx">and you don't have to care about filteringotherwise you have to filter it your self
beside that your module looks pretty solid to me!
Thanks for your contribution and welcome to the community of project contributors on drupal.org! :)
I've granted you the git vetted user role which will let you promote this to a full project and also create new projects as either sandbox or "full" projects depending on which you feel is best.
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
As you continue to work on your module, keep in mind: Commit messages - providing history and credit and Release naming conventions.
Thanks to the dedicated reviewer(s) as well.
Comment #26.0
(not verified) commentedAdded branch to git clone