问题
I have to create a SSRS Report to retrieve the value according to this condition:
- A,B,C,D,E are Five users think,
- A as Junior developer
- B as developer
- C as senior developer
- D as project manager
E as Sr project manager
A reports to B
- B reports to C
- C reports to D
- D reports to E
Then:
- when A logs in he can only see his records
- when B logs in he can see the records for A,B and not able to see the C,D and E records
- when C logs in he can see the records for A,B,C and not able to see the D and E records
- when D logs in he can see the records for B,C,D and not able to see the A and E records
- and when E logs in he can see the records for C,D,E and not able to see the A,B records
Is there any way to retrieve the value this way?
回答1:
You can try as following...
- Create ROLE for each user (A,B,C,D)
- Give permission as your need for each role . For example, B 'ROLE' can access 'B1, B2, B3' tables.
You can also do something like this...
Denying SELECT permission on a table.... The following example denies SELECT permission to the user user1 on the table Person.name in the db1 database.
USE db1;
DENY SELECT ON OBJECT::Person.name TO user1;
GO
For more information :
- http://technet.microsoft.com/en-us/library/ms173724.aspx
- http://technet.microsoft.com/en-us/library/ms188338.aspx
来源:https://stackoverflow.com/questions/19588327/retrieve-value-in-sql