Fields that must be hidden or displayed in web app depending on the user’s preferences

Last Post 24 Feb 2006 12:40 PM by Lee. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
cesar_SQL
New Member
New Member

--
24 Jan 2006 12:47 AM
Hi,

I have a ‘Users’ table in which I have a set of fields that I want the user decides if show them or not in the web application. How can I manage this in the db?

Perhaps create another table, for example:

Table name: data_visibility
Data_v_id = 250, 251, 252, 253
User_num = 47, 47, 47, 47
Data_name = State, City, Address, Zip_code
ShowHide = 1, 1, 0, 0

So, this means user 47 want to show State and City, and want to hide Address and Zip_code.

But then, how can I write the SP so that only returns to the app State and City?
quote:


Select @State_cont = State_cont, @City_cont = City_cont, @Address_cont = Address_cont, @Zip_code_cont = Zip_code_cont

From Users As us

JOIN data_visibility As d_vis
On us.User_id = d_vis.User_num

Where ??¿¿


Thanks
Lee
New Member
New Member

--
24 Feb 2006 12:40 PM
You are going to have to case out the values returned from your translate table and assign either the value or NULL I suppose, depending on what his or her rights are. Not a graceful way of doing this, I would probably let the Bus. layer handle this type of logic if possible. Works here well and we're running major volumn with lots of different users assignments and permissions.
You are not authorized to post a reply.

Acceptable Use Policy