refactored admin and teacher authorization. pulled similar code togeter into a single method.