Refactor checkAccess to isAllowed