Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
30 Jun 2014 at 07:22 UTC
Updated:
31 Jan 2015 at 10:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxrpsu2294717git
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #2
acaster commentedHello Perttu Helle and thank you for your work!
Pareview / Coder review: NO
http://pareview.sh/pareview/httpgitdrupalorgsandboxrpsu2294717git
FILE: /var/www/drupal-7-pareview/pareview_temp/role_expose.test
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
FILE: /var/www/drupal-7-pareview/pareview_temp/role_expose.test
FOUND 118 ERRORS AND 6 WARNINGS AFFECTING 78 LINES
README.txt/README.md
Follows the guidelines for in-project documentation and the README Template.
Manual review
Not found troubles
Secure code
Not found troubles
Code Style
Add configure = admin/config/people/role_expose in your .info file to make it directly accessible from module page.
You should create separate permission for admin/config/people/role_expose in your page instead of using default administer site configuration. Also you should keep this form in separate admin.inc file.
You have comment than more 80 characters in 1 line (at line 5 - role_expose.module)
You haven't "return" after "switch" into function role_expose_help($path, $arg)
Comment #3
rpsuThanks for the review!
I updated some of thing you mentioned and for some of those I think they have no need to to be changed.
What I did not do is:
'access arguments' => array('administer exposed roles'),SimpleTests and Pareview.sh are now green and clean:
http://pareview.sh/pareview/httpgitdrupalorgsandboxrpsu2294717git
Comment #4
pkamerakodi commentedHi,
1) role_expose_form add a line break before return statement
2) we dont see need a switch statement in role_expose_help.
3) You can change if ($account == FALSE) { to if (!$account) {
4) $render_array['role_expose_user_role'] = array(
'#prefix' => '
'#suffix' => '
',
'#markup' => "
" . t('Provided user (user id @user_id) does not exist.', array('@user_id' => $uid)) . "
",
);
Instead you can try using theme_html_tag
5) role_expose_viewable_roles_list add a line break before the return statement.
6) It is good practice to pass a default value when using variable_get for ex:
variable_get('role_expose_show_role_' . $role_id, FALSE);
Regards,
Prajwal
Comment #5
rpsuFixed.
I see the point as there is only one case. However switch -statement seems to be common way to implement hook_help() both in core and in contrib, namely in examples-module. This is why it is using switch-statement and I'd rather leave it like that.
Fixed.
Fixed. Good tip, I've not used that function before.
Both are now fixed.
Comment #6
rpsuComment #7
kladrian commented@rpsu, thank you for your contribution.
It's a simple yet useful module, well written, commented and easy to ready code.
It took me a while to figure out how to show roles in user tab but I found the proper configuration page.
I think it would be better to have a checkbox in admin/people/permissions/roles for each role then having a separate admin page. This is the only suggestion I can give you.
Great work !
Automated Review
Best practice issues identified by pareview.sh / drupalcs / coder. None.
Manual Review
Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
No: Does not cause module duplication and fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements.
3rd party code
Yes: Follows the guidelines for 3rd party code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and the README Template.
Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
Yes. No security issues identified.
Coding style & Drupal API usage
Yes.
Multiple Applications
No.
Thank you again.
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.
Comment #8
rpsuThanks for the review @kladrian!
I looked into how role admin form is built and it looks like it can not be altered easily - user_admin_roles() and theme_user_admin_roles() are more or less built to build exactly default form. If I am not mistaken role_expose -module should rewrite and override theme_user_admin_roles(), and I don't think it is a good idea.
How about if module would print link and some instructions on that page instead of adding checkboxes there? I agree that it is logical place to look for role exposing configuration as well.
Comment #9
kladrian commentedHi @rpsu!
The link is a great idea.
However I've written some code just to show you how I imagine the administration section :)
you can check by going to roles admin page
http://yoursite/admin/people/permissions/roles
and/or editing a role
^^
Comment #10
gaurav.pahuja commentedAutomated Review
Yes.
http://pareview.sh/pareview/httpgitdrupalorgsandboxrpsu2294717git
Best practice issues identified by pareview.sh / drupalcs / coder. Please don't copy/paste all of the results unless they are short. If there are a
lot, then post a link to the automated review and mention that problems should be addressed.
Manual Review
href="https://www.drupal.org/node/2181737">README Template
.Comment #11
joachim commentedThis is definitely not hook_form()!
It would be more efficient -- for this code, and probably for variable memory -- to make this checkboxes and a single array variable.
Role Expose -moduleTypo.
This is maybe better in hook_help().
This is a lot of work to handle a user mistake. If a user enters 'user/UID/role' where UID is not a user, a simpler and more correct response is to return a 404. Drupal's menu system has a helper function for that.
Missing param docs.
Needs a theme function maybe.
BTW, did you consider exposing this on the user profile instead?
Comment #12
rpsuThank you for the reviews and a few good tips as well!
Now Role exposing form is in system Roles page (instead of dedicated page), right below role weight table as @kladrian suggested. Took me a while as I first tried to modify that table to include exposing checkbox. Now exposing roles uses the same permission as modifying all roles and user permissions and IMO it is slightly simpler to follow both on code and UI.
Role listing is also moved, now on profile page (instead of separate profile page tab) as @joachim suggested. Roles are viewable only with proper permissions.
Quite lot of changes so interdiff is also long. Tests go green and pareview.sh is clean as well.
Comment #13
skdrupal88Hey the code looks really clear, but here's my two cents:
1)
package = "User management"- it's not necessary to wrap package name to double quotes http://cgit.drupalcode.org/sandbox-rpsu-2294717/tree/role_expose.info#n52) You have to use drupal variable_del() function instead direct db query in hook_uninstall() http://cgit.drupalcode.org/sandbox-rpsu-2294717/tree/role_expose.install....
Comment #14
rpsuThanks for the review and your two cents @korgik!
Both of those issues are now fixed and interdiff is attached.
Comment #15
rpsuComment #16
luke_nuke commentedIn readme there is:
but there is no such page.
The actual settings are under Administration » People » Permissions » Roles at the very bottom which was hard to find.
In line 163 of role_expose.module there is:
I think there should be:
Because administering users also allows accessing profiles. After changing this +1 for RTBC from me.
Added:
Or rather:
Because administering users should give all relevant privileges automatically :) .
Comment #17
rpsuThanks - and yes, the latter one is the right one :)
Both of these are now fixed.
Comment #18
luke_nuke commentedYou changed path in README to Administration » Configuration » People » Roles , however this is still misleading. The proper path is Administration » People » Roles ( Administration » Configuration » People and Administration » People are two working paths that are leading to something different ) .
Comment #19
rpsuOH, you are correct, it was misleading.
For README.txt correct UI path is actually Admin > People > Permissions > Roles, since Roles-is a 2nd level tab inside Permissions-tab.
Comment #20
Swarnendu-Dutta commentedAutomated Review
Yes.
http://pareview.sh/pareview/httpgitdrupalorgsandboxrpsu2294717git
Best practice issues identified by pareview.sh .
Manual Review
Here is what i did.
1. Enabled the module. Set the permissions.
2. Exposed couple of roles in admin/people/permissions/roles but when i de-select all the roles it throws an error message
Notice: Undefined variable: rids in role_expose_user_admin_roles_submit() (line 107 of /opt/lampp/htdocs/testbox/sites/all/modules/role_expose/role_expose.module).Comment #21
ajits@Swarnendu-Dutta Is there something else that you could find that is blocking the review? Should this be in RTBC?
Comment #22
Swarnendu-Dutta commentedOnly that the notice message comes up mentioned earlier..Dsnt affect with the functionality though..
But needs to be fixed before a stable release.
Looks good to me..
Setting this to RTBC.
Please participate in the review bonus program, so that you get a review from GIT administrator.
Thanks for your contribution.. :)
Comment #23
rpsuThanks for the review. @Swarnendu-Dutta, I fixed the notice you mentioned (committed) and will participate in review bonus -program in a couple of days.
Comment #24
rpsuComment #25
rpsuComment #26
rpsuComment #27
rpsuI've now reviewed three projects (2 modules, 1 theme) and therefore tag this application with PAReview bonus.
Comment #28
klausifixing tag.
Comment #29
klausimanual review:
<script>alert('XSS role');</script>then this will trigger a nasty javascript popup. You need to sanitize all user provided text before printing, make sure to read https://www.drupal.org/node/28984 again. This is not a security issue, since the permission to enter such malicious roles is "administer permissions" which has the restrict access => TRUE flag set. You should still fix this attack vector.Although you should definitely fix those issues they are not application blockers, so this looks good to me.
Thanks for your contribution, rpsu!
I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!
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.
Thanks to the dedicated reviewer(s) as well.
Comment #30
rpsuThank you @klausi and all other reviewers as well - all issues are now fixed and project promoted to full project! Yay!