login function updated to return the permission value