Hi Praveen,
Can you check the based on logged in user name is equal to specified in role in the site. Have you looked into doing this with the use of "user roles" in the InfoPath forms? I believe that you can specify read only with user roles pretty easily. The way to do this is using "conditional formatting". For each field you can set conditional formatting to make a field read-only based on another field or a role.
With roles you have to know the user's login names. However, you can add a rule on the submit button to set the status value of a hidden field on the form (a node in the data source that doesn't have a control on the view). Then your "conditional read-only" can be set based on that node.
If you want to create two views and one is for editable view and another one is read only view. You can check logged in user name is equal to specify your role name then you can switch view depends on your condition in Onload function.