Check permissions before login.