How to implement access control on custom view?

I am creating a custom view on Sugarcrm 7.6 Enterprise. Is there any example/ guide to do access control based on role? Furthermore, is it possible to implement access control on field ?