Drupal 6: Want to remove access restrictions on a View - drupal

I have a View with a Page display that only allows the returned data to be linked if the user is authenticated/logged in.
I simply want to remove that restriction. There is another view that looks the same except it's for Public and shows all the same data but not linked. (the data are pdf files).
On the authenticated display, next to Access in the Basic Settings it has: authenticated user. If I click that user role (not the gear for options), then I'm allowed a list of:
Domain
None
Permission
Role
…for access restrictions. I click "None", save. But, the links are not there as an anon visitor. Same if I try by changing the user to Anonymous User. Note: In the permissions, anon has the right to see webfm attachments.
I noticed the url is like: documents-public or documents-auth so I made it just documents. No luck.
I visited the actual custom-page-type which puts the View in a content pane. I re-ordered the variants, removed all Selection Rules and that didn't do anything either.
Flushed all caches.
Somewhere, the view is still only showing a view based on whether a user is authenticated or not even though I've removed the access (it says "unrestricted" next to access) on both displays and removed all selection rules on the actual page.
I'm stuck where else to look.

The setting you're changing (Access restrictions) is for the entire page - the page URL will return a 403 error if the criteria are met.
As to where the logic is to display/not display the link, four things come to mind:
If the "view mode" is set to node or teaser, it could be in the node template file.
The logic might be in a specific view template (click on the theme information link and see if any of the templates have been overridden).
The developer might have user Views Custom Fields to put the logic directly in the fields.
The linked content is actually restricted.
I'm sure there are other possibilities too. The main point here though is that if access was restricted for anon users, they would see a 403 error, not just some missing fields.

Related

Ensure a Rules Link only shows in a set type within a Panel Page (Drupal)

I've created a Rules Link (in a View) which shows in a users dashboard using Drupal v.7.27 as CMS for a number of (similar) projects using the same functionality. The Rules Link is set to 'trigger' a rule when the user clicks "Post Content" (the Rules Link). The Rules link works fine and fires the trigger which then follows the simple conditions I've set and only because I've created Variant Panel pages for each User Type, the Rules Link only shows on the ones I've set the Panels Page Access conditions (ie Role: Content Manager).
However, I've noticed that as I'm also using the Support Ticket Module, then "Post Content" Rules Link is also showing on the top of the list of a users Support Tickets list (only for testing here, but it's shows my test comments from both user and Admin user) AND* it also shows on a link on all other Node types.
Clearly I don't want the Rules Link to show at the top or bottom of any other content type other than a Node (ie on the Post New Content Panel Page). At the moment is set within the Rules "Edit Bundle" section to show across 'none' as there is no option to force it to show ONLY on my Dashboard Panel. I'm also using the 'Render' Rules option and tried every option but to no avail after a few hours.
I've had to set the option to 'Nodes' in the Entity type which the Rules Link is attached to (because my Article data is a Node within the Panel Page) and it says quote:
'Bundles to which the link should be attached to. If left empty, the link is not restricted for any bundles' under the Bundles section.'
Furthermore, within the Views entity created (used to set the 'Rules Link' into any Node), there is no option that I can find which enforces the Rules Link to only be limited to a particular node, which in my case is a custom Page Panel. Maybe I lack current Drupal knowledge or simply have over looked an issue.
I know I need to learn PHP (yes, currently working through CodeAcademy!) but in order to get the thing working functionally, can anyone advise on what is going wrong and why the Rules Link is showing n other Node types and for a PHP novice like me at this stage, could I simply put some PHP in somewhere that would ensure the Rules Link only shows on a set Content Panel on my custom Panel Page.
I hope I have been clear enough and help at this stage is most gratefully received. Thanks in advance.
EDIT:
Actually the Rules Link is showing on all other Nodes (see above*). I've noticed that Bundles might be the key here? I've todate not used Bundles if that helps anyone?
RESOLVED
I found the source of the problem.
The answer is to ensure that the "Render Entity" is un-ticked in the option box:
"Show link when entity is rendered
If checked,the link is shown when viewing an entity to which the bundle and the visibility conditions apply. Only applies to displayed entity types and if no addition variables were added."
I hope that helps any future readers.

drupal give permission to access a content to authenticated user only

I am using a drupal 6. I need to restrict access to certain pages to my site for only the authenticated users. All these pages are having their own primary navigation parent menu, mouse hover on which it shows the sub menu to these pages. Once user clicks on it, it should show the page content if user is authenticated otherwise should show "Access Denied".
I tried to use Content Access module, though it restricts the access to the pages but it does not even show the menu link to anonymous user in menu list.
Is it possible to show menu in menu list, but on clicking on link it should show the access denied message of user is anonymous?
There are 2 ways you can go about this, the field permissions module if you just want to limit to specific fields or you can make a PHP block, call global $user within it, and if the user's role doesn't match on the node type for who you need to be, then call drupal_access_denied()
http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_access_denied/6
The block method is going to be much more efficient because you won't have to configure a billion checkboxes if you have a lot of fields and because if you make the block within a custom module, it will be exportable easily to other Drupal sites.

drupal 6 VIEWS - I'm stumped

I've created a view (Drupal 6) that gets put on the users profile page.
The view is supposed to list all the images that the user has uploaded. However, the view is showing every uploaded image by all users.
(When a user uploads an image, it first gets approved by me, and then posted by me and displayed on the homepage with a credit to them and a link to their user profile -- so they are not the "author" of the post, I always am.)
How can I limit the photos displaying on their user profile to just show the images uploaded by that particular user?
Thank you.
Use arguments handling: add argument - User ID, check "if argument not provided" and select php code: return arg(1); // if views shown as block and you want to show it in user profile, path will like user/UID, so arg(1) return UID.
2Ted: hello Ted! php code will absolutely secured, if you will check it, for example via is_numeric() function. Also users cann't get any images, becuase Views wil use Block display, and you cann't provide for this arguments directly.
2user967969: Additionally about approving: You can create second field, where you will store user profile UID. So for my above text you should use this field for argument handling, instead of user uid.

How I can add "files available for download" to Drupal user profile page

first time here. I have searched all day for my particular issue with no luck.
I have users that have specific roles auto generated (they purchase a game). I want to display files available to their particular role on their user profile page. I just want to know how I can add a generic view or associate a panel with user profile pages. I want this to display for every user, not on a per user basis. Basically it'll act like, say, direct2drive, you log in and go to your user profile basically and see what games you bought. Seems simple but I am having a heck of a time figuring out how to do this.
I am pretty used to using views but I just don't get how to edit the user profiles like I want to.
Thanks!
The simplest way is to install views_attach, and create a view with a Profile display. This displays the View on the user profile pages, rather than on its own page or in a block, and will pass the user's uid to the View as an argument.
Alternatively, if you're already using comfortable using panels, you can go to admin/build/panels and enable the Users panel. This replaces the user profile page with a panel, which you can add views, nodes and blocks to as normal.

Display different content for anonymous and logged in users

What I need to accomplish is this:
If an anonymous user visits the site, show regular site content.
If a user logs in to the site, then user-related content appears in place of the regular content.
I would like to accomplish this using the Views module.
I have looked at the Premium module, but it seems to be abandoned. I would like to avoid using the content-access module if at all possible, since I already have other access controls in place.
If you are creating a page display for the views, you can accomplish this with view's access controls. Views will show the first available display that the user has permissions to.
Create a display for the authenticated user view
Set the page path
Set the Access restrictions (eg., by Authenticated role)
Create a display for the anonymous user view
Set the page path to the same value
Optionally restrict access to the Anonymous role (not necessary, since if views can load the authenticated display for the user it will not bother with this one, but may keep it's use clear)
Since you cannot re-order the displays in a view (yet), you must define the views in the order of most restrictive to least restrictive.
For more complex displays, you can use the Panels Pages module to render the page differently based on a user's role.
If you only want to differentiate between anonymous and authenticated users, you can specify that different content blocks are visible to each role.
On my own site, I needed to differentiate between Administrators and everyone else, so I could not use the authenticated user role to define access for individual items. Similar to Views, with Panels Pages you can define multiple variants of pages that use the same path. Administrators have access to the first variant, and all other users fall through to using the second.
You could try using the CCK content permissions and set permissions on a per field basis. Then have different fields for different content that you want to publish. I believe this is included with the CCK module.

Resources