none
Does Entity Framework 4.0 support role base security? RRS feed

  • Question

  • We have a number of applications we are attempting to convert from Oracle Forms to C# and we are using the ODT.NET and ODP.NET so we can make use of Entity Framework 4 (even though we are leaving Oracle Forms our backend is staying Oracle).

    In our Forms applications we had 2 primary roles, one with select or view privliges (the default role) and the other with create and update. Whenever a user logs into the application, their role would be changed so they can do create/updates. This allows users to view the data in TOAD or other applications, but they can only make changes when they are in our forms applications. This worked great in Forms because they had one continuously opened session with the database. Now in Entity Framework there is no longer one continuous session. I believe its called "stateless" meaning we go to the database, get/update data, and close the session, however that process could be repeated hundreds of times.

    Is there any sort of built in functionality to Entity Framework 4 that allows you to get the role, or set/change the role for the lifetime of the session (ie. the EntityConnection)?

    I have been unable to find anything that would support roles, yet I find that hard to believe that there is no support for roles in EF, and am really hoping I am just missing something.

    If there is nothing built into EF4 to change a role, can anyone suggest a work around for dealing with the role based security we have in place? Or perhaps there is a better/more secure approach to we could implement that allows a similiar security feature?

    The same question is roughly posted here on stack overflow as well if interested.

    stackoverflow.com/questions/20954305/change-oracle-database-roles-in-entityconnection-of-ef4

    Thank you for your time and help!!

    • Moved by Eason_H Wednesday, January 8, 2014 6:03 AM
    • Moved by Dave PatrickMVP Thursday, January 9, 2014 2:23 AM
    Tuesday, January 7, 2014 10:59 PM

Answers

  • Hello,

    >>Whenever a user logs into the application, their role would be changed so they can do create/updates

    Unfortunately, Entity Framework is not so intelligent to judge the role type. For what you want I think we need to do it in the program the way using the session or use a table to mark the competence of the login user.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, January 10, 2014 9:59 AM
    Moderator

All replies

  • Hi _whit,

    We can't provide support about oracle database. You can consider ask the question in Oracle forum.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, January 8, 2014 6:03 AM
  • I am not asking for any support regarding Oracle database. I do not ask any questions about Oracle. My only question is about Entity Framework and its features/capabilities. I simply gave some context information in hopes that it would help someone in answering the question.

    Please move this question back to the correct forum.

    I need help using and understanding Entity Framework 4, please read the entire question and you will understand that, it has nothing to do with Oracle.

    Thanks.

    Wednesday, January 8, 2014 2:55 PM
  • Hi _whit,

    You can consider posting it in this forum: http://social.msdn.microsoft.com/Forums/en-US/home?forum=adodotnetentityframework, it is the best forum for Entity Framework 4.0 question.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 9, 2014 1:51 AM
  • Hello,

    >>Whenever a user logs into the application, their role would be changed so they can do create/updates

    Unfortunately, Entity Framework is not so intelligent to judge the role type. For what you want I think we need to do it in the program the way using the session or use a table to mark the competence of the login user.

    Regards.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, January 10, 2014 9:59 AM
    Moderator