×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

How to retrieve Security Filter for a User using SDK ?

How to retrieve Security Filter for a User using SDK ?

How to retrieve Security Filter for a User using SDK ?

(OP)
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 !!! :(

RE: How to retrieve Security Filter for a User using SDK ?

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.

RE: How to retrieve Security Filter for a User using 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...

RE: How to retrieve Security Filter for a User using SDK ?

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.   

RE: How to retrieve Security Filter for a User using SDK ?

(OP)
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 ?

RE: How to retrieve Security Filter for a User using SDK ?

(OP)
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.

RE: How to retrieve Security Filter for a User using SDK ?

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close