BO CheckSecurity Event


Author
Message
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
C#



if(e.PermissionKey.Equals("MyEditKey"))

{

e.PermissionInfo = new MicroFour.StrataFrame.Security.PermissionInfo(MicroFour.StrataFrame.Security.PermissionAction.Deny, "Denied", MicroFour.StrataFrame.Security.DeniedActions.Message);

}




Russell Scott Brown
Russell Scott Brown
StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)StrataFrame User (278 reputation)
Group: Forum Members
Posts: 124, Visits: 597
I would please like to see a C# example....

Russ Brown (Using C#2010/SQL Server 2008)
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
Well, it should give you the permission key being checked. You can then create the permission info (or at least I am pretty sure you should be able to) BigGrin. Try something like this:



If e.PermissionKey.Equals("MyEditKey") Then

e.PermissionInfo = New MicroFour.StrataFrame.Security.PermissionInfo(MicroFour.StrataFrame.Security.PermissionAction.Deny, "Denied", MicroFour.StrataFrame.Security.DeniedActions.Message)

End If




Let me know if you need a C# sample instead.
Chris Diesel
Chris Diesel
StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)
Group: StrataFrame Users
Posts: 74, Visits: 300
Sorry I'm so clueless, but could you please provide a sample of using the CheckSecurity event to prevent an edit.  I see conflicting info in samples here on the board vs the documentation vs what is actually available when I'm trying to code CheckSecurityEventArgs (using version 1.6.6.9).  How is the edit actually cancelled through this event?
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 guess I may not understand your environment as this would be something that I would handle in code and just disable any edit actions or when IsDirtyChanged fired (if you are allowing edits without being in edit mode) I would test then, show a message box and then cancel the changes.



But the easiest way would be to just disable the edit if it isn't allowed. The only issue with this is if the Edit is just "disabled" then users will generally wonder why. So I generally try to show some type of message, label, etc. so that they are "clued in" as to why they cannot edit the record.



But like this thread suggests, you can use the CheckSecurity event to prevent editing as well. So all in all there are number of ways to go about this.
Chris Diesel
Chris Diesel
StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)StrataFrame User (128 reputation)
Group: StrataFrame Users
Posts: 74, Visits: 300
I know this is an old thread, but how do I deny an edit or disable edit based on the status of a record not based on security?  In other words, a record is "closed out" and not allowed to be edited anymore by anyone (once again, not a security issue).  I would prefer to just disable the edit button vs the user having to click on edit and then get a message but either way is better than nothing.
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
Really!!! Laugh  I guess that is good to know.  Never right trim and left trim a string and bind that property to a control....got it Smile
Scott
Scott
StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K
One of the guys here figured it out.  Want to have some fun.....  set the left and right trim option on a bo's property, link it to the rtf control and type away.
Scott
Scott
StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)StrataFrame User (198 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K

Thanks, that was the first thing that poped into my head also, but unfortunately it is set correctly.  Today is one of those days that I really dislike .NET!!!!!Angry
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 haven't heard of this before...the only thing I can think of is that some "rightToLeft" property has been set.  This property exists for languages who go backwards Smile  This is definitely nothing StrataFrame specific, but I know that .NET has support for this type of functionality.

The first thing I would look at is the RightToLeft property.

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