Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to retrieve Security Filter for a User using SDK ? 1

Status
Not open for further replies.

CodeLover55

Programmer
Oct 16, 2002
16
0
0
US
I am using Microstrategy SDK 7.1.4 and want to retrieve the Security Filter Expression Text for a particular User ID. How can I do that ? I tried a lot of different things but can't find the right objects and the right APIs to do this !!! :(
 
security filters are specific to a project and user. So they exist as linkitems. You'll have to use the dsslink objects and the finditem method.

refer to "Software Development Kit Developer Guide: Extended Functions" manual. The specific sections are the extended properties chapter that covers linkitems; and the security chapter that covers how security filters are created using the sdk.
 
OK, let's assume that you have connected to a project and have a valid session. I am also presuming that you have done an object search to find the folder where the security filters are contained. Once you have that folder contained as an object then you need to loop through that object for every security filter. You can get what you need from every filter once you have it contained as an object...but you might have to do a recursive search if your filters use embedded filters, metrics, etc.


'sample code only
'-----------
Dim oSource as IDSSSource
Dim oSearch as IDSSSearch
Dim oSecurityFilterFolder as IDSSFolder
Dim oFilter As IDSSMDSecurityFilter
Dim sTemp
Dim i

oSearch = oSource.NewObject(DSSTypeSearch)

oSearch.Types.Add(IDSSFolder)
oSearch.NamePattern = "MD Security Filters"

Set oSecurityFilterFolder = oSearch.Execute

'then do something like this
for each oFilter in oSecurityFilterFolder
for i = oFilter.Dependents.count
lstTemp.Item = oFilter.Name
lstTemp.Item = oFilter.Dependents.Item(i).name
'you can do lots of other stuff here...
next
next


I've assumed a lot with this code...
 
The code I supplied is great for getting information about a filter, but if I understand your problem correctly, you need to find which users use the filter. Given the security filter I don't think it works that way...I think you need to go the other way, where you have the user info, and you do a search on that user's security filter.

Once again nlim is right that you really have to dig into the linkitems interface, and find out how two objects (user and security filter) are linked.
 
Thanks Guys. I looked at the extended function guide and the section on link items doesn't make a lot of sense to me. I am sorry to bug you but can either one of you give me some clues as to how to use the link items on a User ?
 
Basically I intend to achive the following :

Have a VB application with a text box where the client can enter the Microstrategy User ID. When he clicks on "Get Security Filter" button, he should get the security filter expression for this user id. I am new to MSI SDK and am finding it kinna hard to understand things from the documentation. I would really appreciate if you could help me with some sample code or something.
Thanks.
 
Hi All,

Codelover55, did you find solution for your problem?.
Exactly i am looking for answer for the same question you posted.

I am trying to get IDSSUserSecurityFilters object from userobject but i am getting run-time error in VB.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top