Thank you for your question.
Whether or not growing it is legal depends on whether the person has a doctor's recommendation and is growing for personal medical use, or something else. The first is legal but growing commercially for sale is not quite legal yet in San Francisco even if the buyers all have doctor's notes or the buyer is a licensed dispensary. SF licenses dispensaries, see https://www.sfdph.org/dph/EH/MCD/default.asp but does not yet license growers. "The Medical Cannabis Dispensary (MCD) Program permits, regulates and inspects medical cannabis dispensaries in San Francisco. Medical cannabis collectives and cooperatives with nine or fewer members are exempt from local permit requirements."
So if the tenant is part of a small cooperativce or collective it may be legal.
The other major concern is whether the person is growing only using sunlight or is using artificial lighting. Many fires have been started by overloading an electrical system by having grow lights that required more power than the system was designed to handle.
It is not none of your business because you own the property and most leases have a clause saying tenant cannot use the premises for illegal purposes such as running a casino, whorehouse, or butane hash oil lab. It is illegal to use butane or any other solvent to process cannabis. If something bad happens that damages the property and your insurer denies coverage claiming you knew or should have known about the grow operation or whatever, you are going to have a bad time in court trying to get the insurer to pay for the damage.
So, a small personal medical grow is legal and would not usually overtax a commercially wired building but a larger operation is usually illegal and as noted SF does not permit them.
You may want to discuss this with the master tenant and subtenant directly and inspect your property if necessary to determine the scale of the grow operation and whether they intend to do any processing that involves solvents.
My personal opinion is that using electricity to grow a plant make no sense at so many levels I would never condone it. A modest grow using sunlight does make sense.
Please let me know if I have not answered your question prior to rating my answer.
I hope this information is helpful.