By StarkMike - 11/15/2006
I have a table that contains rows, obviously. Each of the rows in my table represents a different report. I would like to use role based security to manage which user has access to which report. What I'll do is fill a listview and give them the ability to select and print multiple reports at once. When I fill the listview, I'll only want it to fill it with rows(reports) that this user has access to.I hope this makes sense.
|
By Trent L. Taylor - 11/15/2006
Create a column in your table with the permission required to run the report. Then manually test on the permission:If SecurityBasics.CurrentUser.GetPermission("MyPermission").Action = MicroFour.StrataFrame.Security.PermissionAction.Grant Then '-- Run the report End If There is a lot of documentation about security. If you read through it it may help you to better understand the class structure and how to manually implement security in custom situations. Don't get me wrong, we are glad to answer any questions you have out here on the forum and these are valid questions, I just did not know if you were aware of how much security documentation that existed.
|
By StarkMike - 11/15/2006
You're saying that the column in the Reports table would contain the permissionkey and then use that permission key to look up the permission at runtime? If I had 50 records to check and then add to the listview would that cause a considerable processing lag?When you say security documentation do you mean the Role-Based Security Help file or security documentation in general? Because I have read most of the RBS help file and very little on security in general. Everything we do is in house and not exposed to the outside world so there is little need beyond basic permissions. Thanks. Your suggestion will help. Because what I would like to have is one central way to manage permissions and I like what RBS has to offer. 
|
By Trent L. Taylor - 11/15/2006
You're saying that the column in the Reports table would contain the permissionkey and then use that permission key to look up the permission at runtime? |
Yes. If I had 50 records to check and then add to the listview would that cause a considerable processing lag? No. These requests are scalar, so it will be fast. If you have a problem, show all of the reports and just test the security when the end-user tries to run the report. When you say security documentation do you mean the Role-Based Security Help file or security documentation in general? It is the Security Help.chm file. Attached here is the latest version in case you do no have it downloaded.
|
By StarkMike - 11/15/2006
Thanks Trent, you and Ben are top notch.
|
By Trent L. Taylor - 11/15/2006
Thanks...we are glad to help!
|
By StarkMike - 3/15/2007
I have another question related to this topic... I have since created a maintenance for to manage this table in a run-time scenario and was wondering if there was a way I could use the Security Key Type Editor so that I could look up a key and then have it return that key name so I could insert that into the field in my table.
|
By Trent L. Taylor - 3/15/2007
Yes, you can use the type editor. It is just a class within the MicroFOur StrataFrame Extensibility.DLL. However, this can be used as design-time only.The UI Type Editor class is called SecurityKeyTypeEditor. You can also call the form directly and provide the parms which would be the SecurityKeyTypeEditorDialog.
|
By StarkMike - 3/15/2007
So If i understand correctly, you're telling me that i can use the SecurityKeyTypeEditor but only at design time... OR i can call the SecurityKeyTypeEditorDialog and after passing a few params i could use it at run-time. Right? |
|
By Trent L. Taylor - 3/15/2007
Actually you cannot distribute the MicroFour StrataFrame Extensibility.DLL file. Aside from this even if you could distribute the DLL it would not work as you are expecting at run-time since it requires the StrataFrame database and all of the meta-data. No SF type editors will work at run-time on your distributed application.A type editor is not the solution for anything that is done at run-time unless you are writing a development tool. You are more in need of a browse dialog type of scenario than a type editor from the sound of it.
|
By StarkMike - 3/15/2007
Yes I believe I'm looking for more of a browser functionality. We're using StrataFrame to develop in-house applications and we won't be distributing them outside our company. So, if we have the StrataFrame databases on our "production" server what would be the easiest way to browse the RBS keys? Is there a view I could create? I'm not looking to create/modify, etc RBS without the aid of the your built in editors but I would like to be able to browse them because I have a RBS Key Field in a table. This way when I'm adding records I dont have to remember the name of the keys I can just look them up and have the name inserted into the field. ;-)
|
By Trent L. Taylor - 3/15/2007
It makes no sense to distribute the StrataFrame database and have to maintain your permissions in two databases. Just create a browse that uses the SFSPermissions BO in security. Then just create two search fields for the pm_Key and the pm_Description fields.The type editor will never work in your scenario as the type editor relies on design-time interfaces that cannot be provided at run-time. It is impossible to use any SF type editors at run-time.
|
By StarkMike - 3/15/2007
Great! Where do i find SFSPermissionsBO?
|
By Trent L. Taylor - 3/15/2007
It is in the MicroFOur StrataFrame Security.DLL. The namespace is MicroFour.StrataFrame.Security.BusinessObjects.SFSPermissionsBO. It may not appear in the search list as we supress this from showing up, so you can choose another BO then open the .Designer.vb file and replace your selected BO with the namespace above and you will then be able to get to the fields, etc. The type editors just hide our internal BOs by default so they don't show up in all of your BOs when searching.
|
By StarkMike - 3/15/2007
This is great! I'm really excited about getting this to work! Unfortunately I'm just not exactly sure how to excute what you're telling me. I'm sorry it's just not clicking today.  Could you give me some steps please? 
|
By StrataFrame Team - 3/15/2007
You can drop an instance of the SFSPermissionsBO on your form (you'll have to manually add it to the toolbox). Then, just create a browse dialog like you normally would by searching off of the SFSPermissionsBO object.
|
By StarkMike - 3/16/2007
THIS IS AWESOME! Thanks for all your help!
|
By StarkMike - 3/16/2007
Sometimes answers lead to more questions! HA HA  The FillAll method of the SFSPermissionsBO requires a ProjectPK in order for it to work. Is there a way that I can programmatically retrieve that value so that I dont have to hardcode it into my app? Thanks
|
By StrataFrame Team - 3/16/2007
If you're running at runtime, just pass 0 to the method. The ProjectPK is only used at runtime, and if you pass 0, then it is completely left out of the WHERE clause.
|
By StarkMike - 3/16/2007
Sweet!
|