made the access control generic (to add more elements like View)