Click here to Skip to main content
16,008,719 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
hey
Admin i.e john is linked to hr department when he signup then choose hr department and his data is store in uerss table and in this table there id is set as dep id =2 whihc is dep2
then i want when he login through his login id and password then he only hr documents not other document like finance ,computer science,marketing and i try this query
first i select dep id
SQL
ALTER procedure [dbo].[sphrdoc]

@UserName  nvarchar(50),
@Password nvarchar(50)
as
select DepID from Userss where UserName=@UserName AND [Password]=@Password
Posted
Updated 7-Nov-13 22:24pm
v2

1 solution

This is messy as hell. I can't follow what you're doing. Store an id in the session, the id of a user. Store in the DB what document types that user can see, basically a permission system. Make all the procs take that user id and filter based on those permissions.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900