Friday, June 15, 2012

Write Permission on Fields

Fields can be displayed as read-only to users with specific roles. The Hire Date field in the Employees controller allows all users to edit the field value by default.

The Hire Date field is editable for all users by default.

Start the Project Designer. In the Project Explorer, switch to Controllers tab. Double-click on Employees / Fields / HireDate field node.

Hire Date field in the Employees controller.

Change the “Write” Roles property:

Property New Value
“Write” Roles Administrators

Press OK to save the field. On the toolbar, click Browse to generate the application.

Log in as user/user123%. Navigate to the Employees page, and edit a record. The Hire Date column will not be editable.

When logged in as user, the Hire Date Field is not editable.

Log out, and log in as admin/admin123%. The Hire Date column will be editable again.

No comments:

You can find more about Code OnTime Generator, Data Aquarium Framework, and other great products here.

© 2010 Code OnTime LLC. Intelligent code generation software for ASP.NET. Visit us at