Changed Teacher Controller to check user permissions.