0
0
SCADA systemsdevops~10 mins

User authentication and authorization in SCADA systems - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to check if a user is authenticated.

SCADA systems
if user.[1]():
    print("Access granted")
Drag options to blanks, or click blank then click option'
Avalidate
Bauthorize
Clogin
Dis_authenticated
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'login' instead of 'is_authenticated' causes an error because 'login' is an action, not a check.
2fill in blank
medium

Complete the code to authorize a user based on their role.

SCADA systems
if user.role == '[1]':
    allow_access()
Drag options to blanks, or click blank then click option'
Aguest
Badmin
Cvisitor
Doperator
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing 'guest' or 'visitor' will restrict access instead of allowing it.
3fill in blank
hard

Fix the error in the code that checks user permissions.

SCADA systems
if user.has_permission('[1]'):
    perform_action()
Drag options to blanks, or click blank then click option'
AreadData
Bread data
Cread_data
Dread-data
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'read-data' or 'read data' causes permission check to fail.
4fill in blank
hard

Fill both blanks to create a dictionary of users with their roles, filtering only admins.

SCADA systems
admins = {user: [1] for user, [2] in users.items() if role == 'admin'}
Drag options to blanks, or click blank then click option'
Arole
Broles
Drole_name
Attempts:
3 left
💡 Hint
Common Mistakes
Using different variable names causes NameError or logic errors.
5fill in blank
hard

Fill all three blanks to create a dictionary of usernames in uppercase with their permissions filtered by 'write' access.

SCADA systems
filtered = [1]([2].upper(): perms for [3], perms in user_permissions.items() if 'write' in perms)
Drag options to blanks, or click blank then click option'
Adict
Busername
Cuser
Dusers
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'username' or 'users' inconsistently causes errors or wrong keys.