4

I'd like to scope some cells to particular values if the current user is an SSAS admin.

I'm not sure where I'd even begin to determine that kind of introspection. Any ideas would be welcome please.

Note that I'm using UDM and not Tabular models

Preet Sangha
  • 64,563
  • 18
  • 145
  • 216

2 Answers2

0

As a workaround you can append «;EffectiveUserName=» to connection string. Then try to connect and check for exception. This connection is able to establish with administrative rights only.

-1

See here for how to use the SCOPE function in an IF clause. Inside the clause, the USERNAME() function can be used to return the current user(See here). Hope this helps.

SouravA
  • 5,147
  • 2
  • 24
  • 49
  • Thank you but this doesn't answer the question. I'm **trying to determine if the user is an SSAS Admin** inside the MDX script. All username() gives my is the windows identity of the current user. – Preet Sangha Oct 17 '14 at 13:04
  • You can use conditional operators to compare the username against the admins. Something of the sort of _if username =<>_ or _if username = <_. Get the idea? – SouravA Oct 22 '14 at 11:54
  • Anyways, you should be thinking on the lines of creating perspectives rather than making MDX figure out whether the session user is admin. Tabular models go even one step further and have provision of row level security. – SouravA Oct 22 '14 at 11:57
  • Thanks. How do get the list of admins pls? I can't use tabular for this project. – Preet Sangha Oct 23 '14 at 00:02
  • I can only think of hard coding it. SSAS-->Properties-->Security – SouravA Oct 27 '14 at 14:42