StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Permission QuestionExpand / Collapse
Author
Message
Posted 08/08/2007 7:04:39 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 10:55:06 AM
Posts: 309, Visits: 1,239
My default permission action is set to deny permissions.  I'm writing a routine to loop through a tab control setting the visibility of each tab based on permissions but I only want to check permissions if a permission key exists.

Is there something built in for checking the existence of a permission key, other than using the business object directly or is there a better approach.

Thanks

Tim

Post #10782
Posted 08/14/2007 12:14:47 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 10:55:06 AM
Posts: 309, Visits: 1,239
Just following up on this issue. Any idea's

Thanks.

Post #10860
Posted 08/14/2007 3:41:15 PM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 10:32:08 AM
Posts: 4,565, Visits: 4,547
If you wanting to know if a permission exists regardless of the logged-in users permissions, then you will need to query the BO.  The easiest thing would be to create a scalar method that accepts the key then just returns the count of keys found.  This would be the fastest way.  Our BO rules just check for a duplicate, so you will want to query this yourself.

Dim loCommand As New SQLCommand()
loCommand.CommandText = "SELECT COUNT(*) FROM SFSPermissions WHERE pm_key=@pm_key"

loCommand.Parameters.Add("@pm_key",VarChar)
loCommand.parameters(0).value = "YourKey"

If CType(Databasics.DataSources("").ExecuteScalar(loCommand), Integer) > 0 Then
   '-- It exists
End If

Post #10865
Posted 09/04/2007 4:43:05 PM
StrataFrame User

StrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame UserStrataFrame User

Group: StrataFrame Users
Last Login: Today @ 10:55:06 AM
Posts: 309, Visits: 1,239
I created a PermissionsBO (Mapped to DDT) and created a routine similar to the one you suggested.  When I execute the code  I get the following message when setting the SQL Command Text.

"A class derived from MicroFour.StrataFrame.Business.BusinessLayer must override the property 'TableSchema'"

I have never seen this error before on a BO.  Do I have to do something special for the Permissions Business Object?

Thanks

Tim

Post #11334
Posted 09/05/2007 9:03:13 AM


StrataFrame Developer

StrataFrame Developer

Group: StrataFrame Developers
Last Login: Today @ 10:32:08 AM
Posts: 4,565, Visits: 4,547
I have never seen this error before on a BO.  Do I have to do something special for the Permissions Business Object?

More than likely you did not build the partial class for the BO.  The TableSchema is an abstract property that must be overwritten.  If you look at another BO you will see what this property contains.  Let me know if you need more explanation. 

Post #11342
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 12:57pm

Powered by InstantForum.NET v4.1.4 © 2008
Execution: 0.109. 11 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.