added grantAccess function to index