Peek for Views
jaxpax - November 24, 2008 - 23:05
| Project: | Peek |
| Version: | 6.x-1.0-beta2 |
| Component: | Miscellaneous |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Are you planning on giving this great module possibilities to use with Views module, so that one can invite a anonymous user to a specified view?

#1
Interesting idea - or even invite anonymous users to view arbitrary urls.
In the meantime, a sneaky work around would be to create an empty node page and display the view in a block in the 'content' region, only for that node.
#2
Funny that you mentioned just that; inviting anonymous users to view arbitrary urls. This is exactly what I want to do. Thanks for the tip with a block in a node. I was thinking about using Computed Field just to create a random 6-7 character long "key", together with a node ID, just to make the URL unique and hard to figure out by chance.
I want to take the chance of thanking you and others of your kind ;-) who is making it possible for all of us who wants to build great sites without the skill of coding ourselves. Without your contributions that would not be possible, at least not for some time. So cheers to you all :-)
#3
We are trying to display a view that is 'peekable' so we tried the following:
- Create an empty node page (Peekable)
- Display the view in a block in the 'content' region only for that node.
In order for anonymous users to see the view on the peeked page, we have to grant them the permission 'Access all views' from the Views module.
When doing this, the view is always accessible and is displayed under the 'You are not authorized to access this page.' message.
On the other hand, if we don't grant them this permission, the page is empty and the view is not displayed.
Any ideas?
#4
Don't grant "access all views" to anonymous users! Yikes!
But ou can set view permissions on a per-view basis - if you make only the block version of the view viewable by anonymous users, and restrict the block visibility to that one node, then it'll work [I think].
A more robust and secure version would be if the peek module allowed you to create/assign a peek role that would provide additional permissions above the anonymous user.
#5
No it doesn't work :(
The block version of the view is only visible for one node (and this node is not published but peeked).
So if I make the block accessible to anonymous users, the block is always accessible. You can actually see the block (the view) under 'You are not authorized to access this page.'
And if I make the block only accessible to Admins, when viewing the peek, the block is not displayed at all.
#6
Okay, so you really need the 'create new peek users with a specific role' feature. Look at the function peek_get_user which is where the new peek users are created. It's already got the role argument, which just needs to be filled somewhere, either by changing the default in this function, or in the place where it gets called (the peek_fetch function). You probably also want to assign the peek role to users who already exist in the peek_get_user function.
Can you roll and submit a patch for this? You'd need to add a role selection option in the admin page for a peek_rid variable.
If not, you can also hack your code simply by setting $roles = array($rid => $role_name), in peek_get_user where rid/rolename are specific roles that you have created for your peek users.
#7
Ok I'll try this, thanks a lot for your help!!