Add better checks on access rights