dbTalk Databases Forums  

Dynamic Security scenario

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Dynamic Security scenario in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ellerado
 
Posts: n/a

Default Dynamic Security scenario - 11-07-2005 , 07:35 AM






Hi,
I've been having some trouble implemente a Dynamic Security MDX
scenario.

I have a dimension [Red], that is a parent-child dimension. I've
created a member properties "Users" that contains the users separeted
by ";" (ex: ;u185733;v911868;u184785.

I've been trying the following MDX expression in the "Allowed Member"
box:
Filter([Red].AllMembers,InStr(1,[Red].CurrentMember.Properties("Users"),";"
*+ Mid(UserName,InStr(1,UserName,"\")+1) + ";")<>0)

As 'UserName' comes with the domain, i used
"Mid(UserName,InStr(1,UserName,"\")+1)" to separate the user (ex:
"BEST-DESTMRA\u185733" --- Mid(...) ---> "u185733")

I get the following error:
Unable to process one or more commands. User-generated error - the
dimension "Red" has no valid member. For more information, see your
administrator.

I tried this and it worked:
Filter([Red].AllMembers,InStr(1,[Red].CurrentMember.Properties(*"Users"),";u185733;")<> 0)


,so i supose the error is in:
";" + *Mid(UserName,InStr(1,UserName,"\")+1) + ";"

I've been stuck with this for a while and had no progress.
I'd really appreciate any help.
Thanks :-)
Emiliano


Reply With Quote
  #2  
Old   
Dean Adam
 
Posts: n/a

Default RE: Dynamic Security scenario - 11-08-2005 , 04:10 PM






Your Mid() syntax looks OK. Maybe the USERNAME is upper case. Try
converting it to lower case with the LCase() function, so your MDX would look
like this: -

Filter([Red].AllMembers,InStr(1,[Red].CurrentMember.Properties("Users"),";"
Â*+ LCase(Mid(UserName,InStr(1,UserName,"\")+1)) + ";")<>0)

If that doesn't work, add a couple of calculated members to show the values
that are being compared and browse the cube to see these values. This is a
debugging technique that has served me well in the past. First, I would add
a calculated member to the measures, called CurrentUser, with this MDX: -

USERNAME

If that doesn't make the problem obvious then add another one, called
FormattedUser: -

";" Â*+ LCase(Mid(UserName,InStr(1,UserName,"\")+1)) + ";"

and another, called UserProperties: -

[Red].CurrentMember.Properties("Users")

Good luck.
--
Dean Adam
Magenic Technologies


"ellerado" wrote:

Quote:
Hi,
I've been having some trouble implemente a Dynamic Security MDX
scenario.

I have a dimension [Red], that is a parent-child dimension. I've
created a member properties "Users" that contains the users separeted
by ";" (ex: ;u185733;v911868;u184785.

I've been trying the following MDX expression in the "Allowed Member"
box:
Filter([Red].AllMembers,InStr(1,[Red].CurrentMember.Properties("Users"),";"
Â*+ Mid(UserName,InStr(1,UserName,"\")+1) + ";")<>0)

As 'UserName' comes with the domain, i used
"Mid(UserName,InStr(1,UserName,"\")+1)" to separate the user (ex:
"BEST-DESTMRA\u185733" --- Mid(...) ---> "u185733")

I get the following error:
Unable to process one or more commands. User-generated error - the
dimension "Red" has no valid member. For more information, see your
administrator.

I tried this and it worked:
Filter([Red].AllMembers,InStr(1,[Red].CurrentMember.Properties(Â*"Users"),";u185733;")< >0)


,so i supose the error is in:
";" + Â*Mid(UserName,InStr(1,UserName,"\")+1) + ";"

I've been stuck with this for a while and had no progress.
I'd really appreciate any help.
Thanks :-)
Emiliano



Reply With Quote
  #3  
Old   
ellerado
 
Posts: n/a

Default Re: Dynamic Security scenario - 11-18-2005 , 01:36 PM



Thanks Adam for the tips, but i'm still running into some errors.

I have a W2k with an SQL Server 2000 and MSAS, both with SP4 installed.


I'm trying to create a Dynamic Security MDX scenario. For what i've
read so far (ppt's from David Wicket, Richard Tkachuk and Mosha
Pasumansky), there are 3 possible tecniques: (1)Using member
properties, (2)Using a 'Security cube', (3)Using a UDF. So far, i've
tried (1) and (2), but i prefered (2) because (1) has problems with the
amount of users it supports, caused by a restriction in the lenght of
member properties (256 characters...i think).

But still, no matter what method i choosed, i've ran into the same
error. Please, let me explain.


When creating a Database Role, and when trying to customize my
dimension security, in the Advanced Tab, in the "Allowed Member" box i
write:
Quote:
********************** MDX in Allowed Member **********************
(1)
Filter([Red].AllMembers,InStr(1,[Red].CurrentMember.Properties("Users"),";"
*+ Mid(UserName,InStr(1,UserName,"\")+1) + ";")<>0)
Quote:
(2) Filter([Red].AllMembers,(StrtoTuple("[Users].[All Users].[" +
Mid(UserName,InStr(1,UserName,"\")+1) + "]"),[Measures].[Secure])=1)

************************************************** *************************


In(2), in the "Custom Dimension Security" box, after pressing 'OK' i
get this error:

Quote:
************************************************** **********
Dimension security syntax error:

Formula error - cannot find dimension member ("[Users].[All
Users].[ellerado]") - in a name binding function.

Do you still want to use this expression for dimension security?
************************************************** **********
'ellerado'=the user actually logged in. It could be any user of the
OLAP Administrator group.


Then, i respond 'Yes', and in the "Edit a Database Role" box when i
click 'ok' to save the changes, i get the following error:
Quote:
**************************************
Error occurred while procesing security for cube 'Secure_IP'
(security error'').
**************************************

One more thing, if i write:
Quote:
********************** MDX in Allowed Member **********************
(1)
Filter([Red].AllMembers,InStr(1,[Red].CurrentMember.Properties("Users"),";u185733;")<>0 )

(2) Filter([Red].AllMembers,(StrtoTuple("[Users].[All
Users].[u185733]"),[Measures].[Secure])=1)

************************************************** *************************
Everything works ok, as expected. In (1), the users are separeted by
";" (ex: ;<user-1>;<user-2>;...;<user-n>


I've tried using calculated members to see the information. Not only
the information is as expected...had no problems with lower or upper
case...but also, the mid(), InStr(), LCase(), UCase() returned the
expected values.


My conclusions (or i should better say doubts):
1) The MDX sentece in the "Allowed Members" box is working as if it was
fix. That is, it takes the user actually logged and it builds the
security scenario once and only the first time.
2) It seems that the UserName() function does not work well.

I'm really exhausted with this issue. I've been working with this for
more than a month.
I'd really appreciate any help.

Emiliano



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.