So first, in NYC a landlord cannot unreasonably deny a request to sublet. You must submit a written request at least 30 days in advance, and it must include things like who you'll be subletting to, why you're wanting to sublet, where you'll be during this period, etc...
Under California law, unless the lease specifically prohibits subletting, tenants may have the right to sublease their rental unit. In this case, you would not be able to unreasonably withhold consent.
If you sublet your home when you're not allowed to, your landlord is likely to take action to evict you.
A master tenant is considered a landlord in relation to his or her subtenant, meaning that a master tenant is able to evict a subtenant. Subtenants do not have the right to evict their master tenant or other subtenants or roommates. Similarly, roommates who are co-tenants cannot evict their fellow co-tenants.
Landlords restrict subletting because they want control of who's in their properties. You wanna sublet so you can get out of a lease, so your standards are somewhat reduced. You might not care about security of the place, you might not care about the subletters background, he has a lease with you not the landlord.
Contra Costa County has implemented rent control and just cause eviction protections in certain areas. These laws: Limit annual rent increases. Protect tenants from arbitrary evictions.