We separate features in our database using schemas. For example, all Create & Maintain Value (CMV) objects live within the CMV schema. Of course, each schema uses objects like stored procedures, views, functions etc.
I want to create a set of database roles by schema to use for security purposes. For example:
db_datareader
db_datawriter
cmv_executor //for stored procs and functions
cmv_viewer //for views
So my question is:
How do I GRANT EXECUTE (or whatever) for various views, functions and stored procedures (etc.) by schema and bundle them up into a single role without running each GRANT by hand?