In this tutorial we will assume that we already have a user called "owner" that has a study populated with some samples and files and no permissions has been set at any point, so no one will have access to "owner"'s data.

In this OpenCGA installation we also have the following list of users:

# If we know that those users will always share the same permissions, we can add those users to the pre-existing "admin" group
opencga.sh studies groups-update -s projectAlias:studyAlias --users user1-admin,user2-admin --name admin --action ADD
# We can directly give permissions to the @analyst group. Remember 'analyst' template will assign all permissions but DELETE.
opencga.sh studies acl-update --member @analyst --template analyst -s projectAlias:studyAlias
# We only need to give permissions to the @external group
opencga.sh studies acl-update --member @external -s projectAlias:studyAlias --permissions VIEW_FILES,VIEW_FILE_HEADERS,VIEW_FILE_CONTENTS,DOWNLOAD_FILES
opencga.sh samples acl-update --id sampleName --member @sample_access --permissions VIEW -s  projectAlias:studyAlias
# For every sample in the list...
opencga.sh samples acl-update --id sampleName --member @general_access --permissions VIEW -s  projectAlias:studyAlias
opencga.sh files acl-update --sample sampleName --member @general_access --permissions VIEW -s  projectAlias:studyAlias
opencga.sh individuals acl-update --sample sampleName --member @general_access --permissions VIEW -s  projectAlias:studyAlias