Views Private Access allows you to define a view's access as private, which means that the view will be displayed only if the first argument equals to the current user ID. There is also a global permission for admins.
This module exists from users at issue https://drupal.org/node/305250. The code there was easily accessible. I took it upon myself to get it up to D7, since I use it frequently, and create a project for it in the community. I thought others would find it useful, as well.
https://drupal.org/sandbox/raycascella/2227635
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/RayCascella/2227635.git views_private_access
Comment | File | Size | Author |
---|---|---|---|
#17 | views_private_access_notices.png | 6.59 KB | er.pushpinderrana |
Comments
Comment #1
PA robot CreditAttribution: PA robot commentedGit clone failed for http://git.drupal.org/sandbox/raycascella/2227635.git while invoking http://pareview.sh/pareview/httpgitdrupalorgsandboxraycascella2227635git
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
RayCascellaComment #3
RayCascellaComment #4
briganzia CreditAttribution: briganzia commentedHi,
No documentation for installing the module. I think you should include a README.txt following this schema: https://drupal.org/node/2181737
Comment #5
RayCascellaThanks for the tip! Just cleaned up some code and threw in a README.txt. It's a pretty simple module, but let me know if you think the readme needs some expansion.
Comment #6
RayCascellaComment #7
briganzia CreditAttribution: briganzia commentedHi, I think you should follow a README template as in https://drupal.org/node/2181737.
I've installed the module, I can see the "private" option under page access permission but it can't be saved.
Could you give me some sample of use?
I think this module should be put in "needs work" status and you could specify which tasks you need.
Probably I didn't understand how this module should work...
Comment #8
RayCascellaHi briganzia,
I'm not sure I follow, I've never seen an error when changing the access check. Are you unable to save the view or click Update after changing the access check? Did you get an error message?
After you select Private as your access type, and click Apply, you may see an empty form, since there are no options, but at that point it should have updated the view, and then allow you to click continue. After that, you can save the view in full, to see the result.
I'll be removing the empty form next commit, after also updating the README.txt. Once I get done work, alittle later today, I'll attach an export of a view using the plugin for reference.
Comment #9
briganzia CreditAttribution: briganzia commentedHi Ray,
I created a new views (page and block display) but I dont see empty form after applying Private type. It shows the views main interface but nothing saved. No errors message.
I tested the module on another Drupal installation and the behaviour is the same.
Comment #10
RayCascellaHi briganzia,
Finally, was able to replicate your error! I've fixed the bug and updated the README.txt. Newest code should do it. Hopefully, it all makes sense now and you're good to go.
Thank you for helping me test this bad boy out and get it going.
Raymond
Comment #11
briganzia CreditAttribution: briganzia commentedHi,
now I'm able to run it, it's fine!
:)
Comment #12
RayCascellaComment #13
RayCascellaComment #14
david_garcia CreditAttribution: david_garcia commentedI could not find a single thing to complain about, the module is small and impecably implemented.
Comment #15
RayCascellaComment #16
RayCascellaI've had this waiting for a few months, and I suppose, needs another review? Unfortunately, I've not had time to review other applications, I was hoping my request would move up the queue organically, but it seems to have stalled? There have been two reviews so far, just wondering what I can do to bump it up the queue. Thanks
Comment #17
er.pushpinderrana CreditAttribution: er.pushpinderrana commented@RayCascella o, thankyou for your contribution.
Automated Review
Best practice issues identified by pareview.sh / drupalcs / coder. Yes, http://pareview.sh/pareview/httpgitdrupalorgsandboxraycascella2227635git reported number of issues that need to be fix.
Manual Review
I tested this module functionality, it works as intended but If user forcefully replaced user uid with 0(anonymous user) then it displays requested views data that looks wired, even anonymous user don't have permission for Access all private views. You should correct following code where you are directly checking
$arg[0] == $account->uid
.Other than first point, rest looks good to me. Inline comments and doc are very well managed. Good Job!
The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.
As I am not a git administrator, so I would recommend you, please help to review other project applications to get a review bonus. This will put you on the high priority list, then git administrators will take a look at your project right away :-)
Thanks again for your hard work!
Comment #18
RayCascellaThanks for your thorough feedback, er.pushpinderrana! I'll take look at the code and fix things up.
Comment #19
PA robot CreditAttribution: PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #20
RayCascellaComment #21
Swarnendu-Dutta CreditAttribution: Swarnendu-Dutta commentedHi Raymond,
Thanks for your contribution.
Please update git clone url to git clone --branch 7.x-1.x http://git.drupal.org/sandbox/RayCascella/2227635.git views_private_access
Assigning this to myself. Will do a manual review shortly.
Comment #22
Swarnendu-Dutta CreditAttribution: Swarnendu-Dutta commentedComment #23
naveenvalechaUpdated the git clone url.
Comment #24
RayCascellaThanks for the assist naveenvalecha , didn't realize it needed the folder name tacked on to the end.
Comment #25
davidgrayston CreditAttribution: davidgrayston at Dennis commentedThe automated review has highlighted a few issues with the 7.x-1.x branch: http://pareview.sh/pareview/httpgitdrupalorgsandboxraycascella2227635git...
Coder Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.
The first error meant the module couldn't be enabled
There's also a warning to remove/rename the dev branch: remotes/origin/7.x-1.x-dev
Comment #26
davidgrayston CreditAttribution: davidgrayston at Dennis commentedFatal error prevented module being enabled:
$path_uid = isset($arg[0] && is_numeric($arg[0]) ? $arg[0] : NULL;
This should probably be:
$path_uid = isset($arg[0]) && is_numeric($arg[0]) ? $arg[0] : NULL;
views_private_access_help() is missing
Implements hook_help().
commentComment #27
PA robot CreditAttribution: PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.