Permission Question


Author
Message
Tim Dol
Tim Dol
StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
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

Tim Dol
Tim Dol
StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
Just following up on this issue. Any idea's

Thanks.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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


Tim Dol
Tim Dol
StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)StrataFrame User (408 reputation)
Group: Forum Members
Posts: 340, Visits: 1.4K
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

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.  Smile

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search