handle relevant case

handle relevant case and add permission control
"type" is too vague for this; it's used as a parameter in other cases.  can we go with something a little more descriptive?