Rhino Security: Distinction between different types of operations

77 views
Skip to first unread message

Bart Reyserhove

unread,
Dec 22, 2008, 2:20:45 AM12/22/08
to rhino-t...@googlegroups.com
Hi all,

I'd like to make a distinction between different types of operations. I have operations that are really operations such as for example "Login" but I have also operations for field level access, for example "User/UserName". I would like to make a disctinction between those two. There is a "comment" field in the "Operations" table, but it does not seem right to (mis)use that.

Would you accept a patch that adds a "Type" field to the "Operations" table or do you have another suggestion?

Bart

Ayende Rahien

unread,
Dec 22, 2008, 2:23:09 AM12/22/08
to rhino-t...@googlegroups.com
What would you want that type to contain?

Bart Reyserhove

unread,
Dec 22, 2008, 2:44:05 AM12/22/08
to rhino-t...@googlegroups.com
An integer so that I can use an enumeration with the different types of Operations I need.

Ayende Rahien

unread,
Dec 22, 2008, 2:51:41 AM12/22/08
to rhino-t...@googlegroups.com
Hm, I get a queasy feeling in my stomach for that. Remind me of Win32
Why not?

public class BartOperation : Operation
{
      OperationType OperationIsStronglyTyped {get;set;}

Bart Reyserhove

unread,
Dec 22, 2008, 2:56:57 AM12/22/08
to rhino-t...@googlegroups.com
Good point! 
If I'm not mistaking I can do that without the need to change anything in the Rhino.Security code right?

Ayende Rahien

unread,
Dec 22, 2008, 3:00:10 AM12/22/08
to rhino-t...@googlegroups.com
You should be able to do that, yes.
The idea is that you are simply changing the mapping. I think that the easiest thing would be to do so statically, just by adding BartOp.hbm.xml and selectively getting the mapping for all the other entities.

That would be a great topic for a blog post, by the way

Bart Reyserhove

unread,
Dec 22, 2008, 4:57:19 PM12/22/08
to rhino-t...@googlegroups.com

Marco

unread,
Dec 23, 2008, 5:35:27 AM12/23/08
to Rhino Tools Dev
Nice solution!

Can you show / explain how you're using the field level security in
your application?

Thanks
Marco

On Dec 22, 10:57 pm, "Bart Reyserhove" <bart.reyserh...@gmail.com>
wrote:
> It works:http://bartreyserhove.blogspot.com/2008/12/using-nhibernate-mapping-o...

Bart Reyserhove

unread,
Dec 23, 2008, 10:37:05 AM12/23/08
to rhino-t...@googlegroups.com
I'm using ASP.NET MVC and we created some extensions methods for the HtmlHelper so that we have instead of Html.TextBox(...) an Html.SecuredTextBox. I am preparing a blog post on this topic. Should be ready pretty soon.

Bart
Reply all
Reply to author
Forward
0 new messages