OG Content Access provides the ability to specify role-specific access to content and integrates well with Organic Groups.
By default with OG, any member of the group is allowed to access (or 'view') any kind of content in the group (i.e: blogs, wiki, forums, etc). With this module, it's possible to assign the view access to specific roles in that group.

Why this module
Without this module it will not be possible to create an OG-compatible content type access solution for Drupal (other modules do not play well with OG and simply overwrite it or require patching for drupal core or such).

Project page: http://drupal.org/sandbox/lirantal/1332320
Project git repo: git clone --branch master lirantal@git.drupal.org:sandbox/lirantal/1332320.git
og_content_access
Drupal version: 6

CommentFileSizeAuthor
#7 drupalcs-result.txt7.38 KBklausi

Comments

chakrapani’s picture

Status: Needs review » Needs work

It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:

  • Run coder to check your style, some issues were found (please check the Drupal coding standards):
    Severity minor, Drupal Commenting Standards, Internationalization, Drupal Security Checks, Drupal SQL Standards, Drupal Coding Standards
    
    sites/all/modules/pareview_temp/test_candidate/og_content_access.module:
     +11: [minor] Comment should be read "Implements hook_foo()."
     +14: [normal] curly braces { should end a line, not start one
     +32: [minor] Comment should be read "Implements hook_foo()."
     +35: [normal] curly braces { should end a line, not start one
     +38: [normal] curly braces { should end a line, not start one
     +41: [normal] curly braces { should end a line, not start one
     +43: [normal] curly braces { should end a line, not start one
     +55: [minor] Comment should be read "Implements hook_foo()."
     +58: [normal] curly braces { should end a line, not start one
     +60: [normal] curly braces { should end a line, not start one
     +70: [minor] Comment should be read "Implements hook_foo()."
     +76: [normal] curly braces { should end a line, not start one
     +80: [normal] curly braces { should end a line, not start one
     +87: [normal] curly braces { should end a line, not start one
     +94: [normal] curly braces { should end a line, not start one
    
    Status Messages:
     Coder found 1 projects, 1 files, 11 normal warnings, 4 minor warnings, 0 warnings were flagged to be ignored
    
  • Lines in README.txt should not exceed 80 characters, see the guidelines for in-project documentation.
  • Remove "version" from the info file, it will be added by drupal.org packaging automatically.
  • Remove "project" from the info file, it will be added by drupal.org packaging automatically.
  • @file doc block is missing in the module file, see http://drupal.org/node/1354#files .
  • ./og_content_access.module: comment lines should break at 80 characters, see http://drupal.org/node/1354#general
          // the grant id represents the role id which is allowed access to this node
    
  • ./og_content_access.module: The description on the line after the @param/@return documentation is either missing or not formatted correctly. See http://drupal.org/node/1354#functions
    74- */
    
  • Bad line endings were found, always use unix style terminators. See http://drupal.org/coding-standards#indenting
    CHANGELOG.txt
    README.txt
    
  • Remove all old CVS $Id tags, they are not needed anymore.
    og_content_access.info:1:; $Id
    

This automated report was generated with PAReview.sh, your friendly project application review script. Please report any bugs to klausi.

lirantal’s picture

Committed all changes above including:
1. Moving from master branch to version branch
2. Syntax fixes

I wish to refrain from "fixing" 'curly braces { should end a line as' report as I prefer this coding style for readability.

lirantal’s picture

Any updates?

lirantal’s picture

Status: Needs work » Needs review

updated issue status so it gets another review after suggested fixes.

chakrapani’s picture

Status: Needs review » Needs work

Review of the 6.x-1.0 branch:

  • Drupal Code Sniffer has found some code style issues (please check the Drupal coding standards):
    
    FILE: ...es/all/modules/pareview_temp/test_candidate/og_content_access.admin.inc
    --------------------------------------------------------------------------------
    FOUND 15 ERROR(S) AFFECTING 11 LINE(S)
    --------------------------------------------------------------------------------
      3 | ERROR | The second line in the file doc comment must be " * @file"
     18 | ERROR | Opening brace should be on the same line as the declaration
     19 | ERROR | Inline comments must start with a capital letter
     19 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
        |       | question marks
     22 | ERROR | Inline comments must start with a capital letter
     22 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
        |       | question marks
     26 | ERROR | Inline comments must start with a capital letter
     26 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
        |       | question marks
     45 | ERROR | Expected "foreach (...) {\n"; found "foreach (...)\n  {\n"
     76 | ERROR | Opening brace should be on the same line as the declaration
     79 | ERROR | Expected "foreach (...) {\n"; found "foreach (...)\n  {\n"
     81 | ERROR | Expected "if (...) {\n"; found "if (...)\n    {\n"
     83 | ERROR | Inline comments must start with a capital letter
     83 | ERROR | Inline comments must end in  full-stops, exclamation marks, or
        |       | question marks
     86 | ERROR | Whitespace found at end of line
    --------------------------------------------------------------------------------
    
    
    FILE: ...ites/all/modules/pareview_temp/test_candidate/og_content_access.install
    --------------------------------------------------------------------------------
    FOUND 2 ERROR(S) AND 1 WARNING(S) AFFECTING 3 LINE(S)
    --------------------------------------------------------------------------------
      3 | ERROR   | The second line in the file doc comment must be " * @file"
     15 | WARNING | Format should be * Implements hook_foo().
     18 | ERROR   | Opening brace should be on the same line as the declaration
    --------------------------------------------------------------------------------
    
    
    FILE: ...sites/all/modules/pareview_temp/test_candidate/og_content_access.module
    --------------------------------------------------------------------------------
    FOUND 26 ERROR(S) AND 4 WARNING(S) AFFECTING 24 LINE(S)
    --------------------------------------------------------------------------------
       3 | ERROR   | The second line in the file doc comment must be " * @file"
      15 | WARNING | Format should be * Implements hook_foo().
      18 | ERROR   | Opening brace should be on the same line as the declaration
      36 | WARNING | Format should be * Implements hook_foo().
      39 | ERROR   | Opening brace should be on the same line as the declaration
      40 | ERROR   | Inline comments must start with a capital letter
      40 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
      41 | ERROR   | Expected "if (...) {\n"; found "if (...)\n  {\n"
      43 | ERROR   | Inline comments must start with a capital letter
      43 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
      44 | ERROR   | Expected "foreach (...) {\n"; found "foreach (...)\n    {\n"
      46 | ERROR   | Expected "if (...) {\n"; found "if (...)\n      {\n"
      59 | WARNING | Format should be * Implements hook_foo().
      62 | ERROR   | Opening brace should be on the same line as the declaration
      63 | ERROR   | Expected "if (...) {\n"; found "if (...)\n  {\n"
      74 | WARNING | Format should be * Implements hook_foo().
      82 | ERROR   | Opening brace should be on the same line as the declaration
      85 | ERROR   | Expected "if (...) {\n"; found "if (...)\n  {\n"
      90 | ERROR   | Inline comments must start with a capital letter
      90 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
      92 | ERROR   | Expected "if (...) {\n"; found "if (...)\n  {\n"
      99 | ERROR   | Expected "foreach (...) {\n"; found "foreach (...)\n  {\n"
     102 | ERROR   | Inline comments must start with a capital letter
     102 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     104 | ERROR   | Inline comments must start with a capital letter
     105 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     107 | ERROR   | Inline comments must start with a capital letter
     107 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
     109 | ERROR   | Inline comments must start with a capital letter
     109 | ERROR   | Inline comments must end in  full-stops, exclamation marks, or
         |         | question marks
    --------------------------------------------------------------------------------
    
  • Lines in README.txt should not exceed 80 characters, see the guidelines for in-project documentation.
  • ./og_content_access.module: The description on the line after the @param/@return documentation is either missing or not formatted correctly. See http://drupal.org/node/1354#functions
    77- *  the node being saved
    79- *  the grants that this module declares
    
  • All text files should end in a single newline (\n). See http://drupal.org/node/318#indenting
    ./og_content_access.admin.inc ./CHANGELOG.txt ./og_content_access.module ./og_content_access.install
    

This automated report was generated with PAReview.sh, your friendly project application review script. Go and review some other project applications, so we can get back to yours sooner.

Source: http://ventral.org/pareview - PAReview.sh online service

patrickd’s picture

Status: Needs work » Needs review

Switched back to needs review, so in-depth reviews won't be blocked by coding standart issues.

klausi’s picture

Status: Needs review » Needs work
Issue tags: +PAreview: security
StatusFileSize
new7.38 KB

Review of the 6.x-1.0 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.

manual review:

  • wrong git branch name, "6.x-1.0" should be "6.x-1.x"
  • og_content_access_manage(): "'#title' => $type_name," you need to sanitize this to avoid XSS attacks. Please read http://drupal.org/writing-secure-code and all subpages, especially http://drupal.org/node/28984
  • "'#options' => $site_roles,": same here, you need to sanitize the role names.
misc’s picture

@lirantal has been contacted to ask if the application is abandoned.

After ten weeks with a status of needs work: the applicant may be contacted by a reviewer to determine whether the application was indeed abandoned. The action taken by the reviewer should be documented in the project application issue.

http://drupal.org/node/894256

lirantal’s picture

Assigned: Unassigned » lirantal
Status: Needs work » Needs review

Thanks for contacting me.
I've attended to all of the changes mentioned except for indent programming style which is left with Allman as I'm pretty comfortable with that. Can that go through or should I change everything to K&R style?

patrickd’s picture

Assigned: lirantal » Unassigned

only the current reviewer should assign the issue to himself

The 6.x-1.0 git branch do not match the release branch pattern, you should remove/rename them. See http://drupal.org/node/1015226

As coding standards make sure projects are coded in a consistent style we please you try to fix them. Anyway, note that fixing all issues is not a requirement for getting through the application process.

lirantal’s picture

Thanks Patrick.
Removed the 6.x-1.0 branch.

So I'm awaiting now further updates regarding the module approval from you/the rest of the team.

misc’s picture

Status: Needs review » Reviewed & tested by the community

Ok, this looks like RTBC, but I think you should fix the coding standards issues.

klausi’s picture

We are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)

patrickd’s picture

Status: Reviewed & tested by the community » Fixed

Your project page is not very detailed, please have a look at the tips for a great project page, you may also use HTML-tags for better structure.

There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch:

git checkout 7.x-1.x
git branch -D master
git push origin :master

function og_content_access_menu()
{

should be
function og_content_access_menu() {

foreach ($grants as $key => $grant)
{
if ($grant['realm'] == 'og_subscriber')
{

should be
foreach ($grants as $key => $grant) {
if ($grant['realm'] == 'og_subscriber') {

In general: Put opening brackets on the same line as expressions.

* Implements of hook_node_grants().
should be
* Implements hook_node_grants().

But these are non-blockers, therefore

Thanks for your contribution!

I updated your account to let you 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 get 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.

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