When posting the form to create a new help item, the coolaid_new_form_submit function iterates through role choices to insert roles able to access a help item. When I submit the form, even the unchecked items are in that array. As a result, the roles that were not checked are also inserted into the database, so any help item is available to anybody. This patch does a check to see if the rolekey equals the role, so only checked items are inserted as roles.

CommentFileSizeAuthor
coolaid.patch640 byteswiremilldev

Comments

danielb’s picture

Status: Active » Fixed

Cheers mate, I've changed your patch a little to accomodate this: http://drupal.org/coding-standards just because I suppose more drupal devs are used to that style. One day I'll run my code through the Coder module and see if it picks up on any other code issues.

The patch was tested and added and works fine. Thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

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