Retrive Value in SQL

  • hi

    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?

    thank you

  • In the past, I've done things like this using role based permissions. You can design the system differently, but a lot of the basic building blocks would be to have tables for users, roles, and resources. Users get assigned to roles. Roles get assigned resources. Your records get assigned to resources.

    Although in this case, you'd really want to say something like Junior developer can only see junior developer resources. Senior Developer can see Junior and Senior Developer resources. Project Manager can only see records of whatever type...

    It builds out from there. You just have to be able to assign your records to the right resource.

    When accessing the data for the report, you'd need to access it via stored procedure. You'd have to pass along the User ID and look up the role they belong to. Then you can figure out what the user should have access to in the stored procedure.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply