A. Tenant Configuration
Role-based authorization
Step 1: Role Creation
a) Now, you have to configure the required roles in the tenant profile of your tenant.
b) Go to the Custos Portal→ Click on Admin tenant → Profile → Roles
c) Create roles professor, teaching-assistant, and student
Step 2: Role Assignment
Assign created roles to relevant users. based on the roles reference portal view will be different.
a) Go to the Custos Portal→ Click on Admin tenant → Users→ Click on selected user
b) Assign professor role to a relevant user
c) Assign teaching-assistant role to a relevant user
d) Assign student role to a relevant user
Group-based Authorization
Step 1. Group Creation
Group-based authorization is used when we need more fine-grained authorization than role-based authorization. We can control object sharing with different permission for different user groups.
a) Go to Custos Portal → Select Admin Tenant → Groups
b) Create New Groups
c) Create doctor group and nurse group
Field | Value | Description |
---|---|---|
Group ID | System generated value | Represent ID of the group |
Name | student-group, or teaching-assitant group | Group name |
Description | This is a student group, This is a TA group | Description of the group |
Step 2: Assign users to Groups
Once you created the student group and teaching assistant group. You (Tenant admin ) assign users to relevant groups.
Assign each user to each group.
user A → Assign to student group
user B → Assign to teaching-assistant group
Step 3: Create Entity Types
a) Go to the Custos Portal→ Click on Admin tenant → Profile → Entity Types
b) Create Entity Types
Step 4: Create Permission Types
a) Go to the Custos Portal→ Click on Admin tenant → Profile → Permission Types
b) Create Permission Types
B. Configure portal and run portal
Option 1: Step up canvas portal locally with docker (Recommended)
a) download docker-compose.yml
b) run mkdir canvas_portal (Create a directory called canvas_portal)
c) copy docker-compose.yml file into directory canvas_portal
d) Run the following commands
cd canvas_portal docker-compose up
e) If all the above steps are successfully executed following messages should be displayed in your console.
Recreating custos-demo-gateway_web_1 ... done Attaching to custos-demo-gateway_web_1 web_1 | Replacing env vars in JS web_1 | Processing /usr/share/nginx/html/js/app.58c969ac.js ... web_1 | Starting Nginx web_1 | 2021/06/22 15:58:53 notice 8#8: using the "epoll" event method web_1 | 2021/06/22 15:58:53 notice 8#8: nginx/1.20.0 web_1 | 2021/06/22 15:58:53 notice 8#8: built by gcc 10.2.1 20201203 (Alpine 10.2.1_pre1) web_1 | 2021/06/22 15:58:53 notice 8#8: OS: Linux 4.9.184-linuxkit web_1 | 2021/06/22 15:58:53 notice 8#8: getrlimit(RLIMIT_NOFILE): 1048576:1048576 web_1 | 2021/06/22 15:58:53 notice 8#8: start worker processes web_1 | 2021/06/22 15:58:53 notice 8#8: start worker process 9 web_1 | 2021/06/22 15:58:53 notice 8#8: start worker process 10 web_1 | 2021/06/22 15:58:53 notice 8#8: start worker process 11 web_1 | 2021/06/22 15:58:53 notice 8#8: start worker process 12 web_1 | 2021/06/22 15:58:53 notice 8#8: start worker process 13 web_1 | 2021/06/22 15:58:53 notice 8#8: start worker process 14 web_1 | 2021/06/22 15:58:53 notice 8#8: start worker process 15 web_1 | 2021/06/22 15:58:53 notice 8#8: start worker process 16
f) Now you should be able to load the landing page of the health portal. Go to: http://localhost:8080
Option 2: Run canvas portal with Node
a) Install latest stable nodejs (v14.17) https://nodejs.org/en/download/
b) git clone https://github.com/apache/airavata-custos-portal.git
c) cd ./airavata-custos-portal/custos-demo-gateway
d) git checkout custos-pearc-tutorial-2021
e) M ake sure the following entries are in .env file
VUE_APP_CLIENT_ID="" VUE_APP_CLIENT_SEC="" VUE_APP_REDIRECT_URI="http://localhost:8080/callback" VUE_APP_CLIENT_ENTITY_TYPE_ID_ASSIGNMENT="ASSIGNMENT" VUE_APP_CLIENT_ENTITY_TYPE_ID_SUBMISSION="SUBMISSION" VUE_APP_CLIENT_ENTITY_TYPE_ID_GRADING="GRADING" VUE_APP_CLIENT_ROLE_PROFESSOR="professor" VUE_APP_CLIENT_ROLE_TEACHING_ASSISTANT="teaching-assistant" VUE_APP_CLIENT_ROLE_STUDENT="student" VUE_APP_CLIENT_GROUP_ID_STUDENT="" VUE_APP_CLIENT_GROUP_ID_TEACHING_ASSISTANT="" VUE_APP_CLIENT_PERMISSION_TYPE_VIEWER="VIEWER" VUE_APP_CLIENT_PERMISSION_TYPE_EDITOR="EDITOR"
f) npm install
g) npm run serve
If 'npm install' command gives errors please try below yarn commands
f) npm install yarn -g
g) yarn install
h) yarn run serve
Now you should be able to load the landing page of the health portal. Go to: http://localhost:8080
But still, we did not configure the sample canvas to use Custos endpoints. We need to copy Custos client Id and Secret from the tenant portal and copy them into the docker-compose file and restart the docker container.
a) Go to the Custos portal again and click on your tenant and grab the Client ID and Secret.
b) Copy and paste the following credentials to your docker-compose.yaml
VUE_APP_CLIENT_ID: 'custos-3infegrx7mq9cv7akd5s-10002422' VUE_APP_CLIENT_SEC: '341sog5DlQv2vXEB3GL4yAMdz5CLfzKFyVkDLUeF'
c) Execute following commands
Press CTRL + C docker-compose up
d) If you are using the native approach just stop and start with
npm run serve
or
yarn run serve
The above steps should enable Institutional/ Google/Github login.