BO CheckSecurity Event


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



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

{

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

}




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