About Me

My photo
Northglenn, Colorado, United States
I'm primarily a BI Developer on the Microsoft stack. I do sometimes touch upon other Microsoft stacks ( web development, application development, and sql server development).

Wednesday, November 13, 2013

SSRS: Hide this column function

A bit of code from SQL Server Magazine on handling column specific security based on userid that is found in SSRS.

Function HideThisColumnFrom(strUserID as String) as Boolean
   Select Case strUserID
      Case "domain\user1" : Return False
      Case "domain\user2" : Return False
      Case Else : Return True
   End Select
End Function

Not ideal, and it is suggested using SQL Server to house a table of users, etc....

I think it would be best to write a sql scalar function that accepts a userid and based on permissions/roles send back either a bit-string or a string of roles separated by a delimiter which then can be deciphered by a function on the SSRS side. The function then would determine by sending in the roles into the function and return the True/False.



 

No comments: