for s3 role based code