views:

26

answers:

1

Hi,

I have a set of records which 1 column called "Site" (I used CCK for this)

I want some user to access Site A data while others just access Site B

I enabled Profile module, add a custom field called Site, then for user 1, I set the value of that Site field to A, and for user 2, I set it to B

However, I don't know how to specify the Filters in Drupal Views to compare that "Site" field in CCK object with the "Site" field in the Profile of current logged in Users

Anyway to do this or any other equivalent way to restrict access to data based on custom fields in User Profile ?

Thanks

A: 

You might want to check out the content profile module: http://drupal.org/project/content_profile. It allows you to create a new content type to extend the user profile. With this, content profiles are essentially nodes and will give you more flexibility within views.

Also, I'm not sure I completely understand your problem. You state:

I want some user to access Site A data while others just access Site B

This sounds like you need to set up different roles to assign users and use one of Drupal's access control modules like content access:

http://drupal.org/project/content_access
http://more.zites.net/content_access_for_drupal_6

bkildow
Hi,For example, I have a CCK content type with following columns (Site, Customer, SoldQuantity)Site A, John, 100 | Site B, Peter, 50 | Site A, Dave, 200 | Site A, Jim, 17 | Site B, May, 200.I want some users to just see those "Site A" records in their Views, and some users to just see those "Site B" records in their Views.I can enable Profile or Content Profile module, however the problem is : there is no way (that I know of) to compare a CCK field (Site field in my case) with some dynamic variable (Site field in User Profile)Hope it's clear enough. Thanks for your supprot
Sim

related questions