Checking whether a user has permissions