title: Reporting Services User as a User Permission Key - Row level permission SSRS
body: <p>I want to create a row level permission to a report in Reporting Services. I would like to give specific users a specific access to data  - projects. A Project Manager can read data only for his projects.</p>
  
  <p>I wish to limit it using SS Reporting Services Users. I only have one user - "reportviewer" who has access to sql and don't want to create more users in sql database.</p>
  
  <p>But I have problem, I don't know how can I use SS Reporting Services Users (which logins are like SERVERNAME\UserName).
   I know I must have an access permission table like this one below:</p>
  
  <p><strong>USERLOGIN              PROJECT</strong></p>
  
  <p>SERVERNAME\Matthias    Project12</p>
  
  <p>SERVERNAME\Matthias   Project13</p>
  
  <p>SERVERNAME\Tommy   Project14</p>
  
  <p>I wan't to have code with restrictions for user in my SQL view. something like that</p>
  
  <pre><code>  Where 
     (a.NrProjektu in (Select NrProjektu From tbn.SSRSRaportyDostepView Where LoginUser=USER_NAME() ) OR
          IS_ROLEMEMBER('db_owner') = 1 OR
          IS_SRVROLEMEMBER('sysadmin') = 1
          )
  </code></pre>
  
  <p>But when i check USER_NAME() it is like "dbo". As I understand this "USER_NAME()" refers to sql user.</p>
  
  <p>I wish to have some connection like I can use in Reporting Services report like " Where UserName=@ReportUser". I don't know how to implement in SQL.</p>