File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -144,6 +144,12 @@ $LTI{v1p3}{LMSrolesToWeBWorKroles} = {
144
144
' Grader' => ' ta' ,
145
145
};
146
146
147
+ # The LMS reports roles context (or membership), instititution, and system
148
+ # roles. WeBWorK always ignores system roles, and also ignores institution
149
+ # roles by default. In some cases you may also want to consider institution
150
+ # roles. In that case set the following to 1.
151
+ $LTI {v1p3 }{AllowInstitutionRoles } = 0;
152
+
147
153
# ###############################################################################################
148
154
# Local routine to modify users
149
155
# ###############################################################################################
Original file line number Diff line number Diff line change @@ -369,10 +369,15 @@ sub create_user ($self) {
369
369
# Determine the roles defined for this user defined in the LTI request and assign a permission level on that basis.
370
370
my @LTIroles = @{ $self -> {roles } };
371
371
372
- # Restrict to institution and context roles and remove the purl link portion (ignore system roles).
372
+ # Restrict to context roles and remove the purl link portion. System roles are always ignored, but institution
373
+ # roles are also included if $LTI{v1p3}{AllowInstitutionRoles} = 1.
373
374
@LTIroles =
374
375
map {s | ^[^#]*#|| r }
375
- grep {m !^http://purl.imsglobal.org/vocab/lis/v2/(membership|institution\/person)# !} @LTIroles;
376
+ grep {
377
+ m ! ^http://purl.imsglobal.org/vocab/lis/v2/membership#!
378
+ || ($ce -> {LTI }{v1p3 }{AllowInstitutionRoles }
379
+ && m ! ^http://purl.imsglobal.org/vocab/lis/v2/institution/person#! )
380
+ } @LTIroles ;
376
381
377
382
if ($ce -> {debug_lti_parameters }) {
378
383
warn " The adjusted LTI roles defined for this user are: \n -- " . join (" \n -- " , @LTIroles ),
You can’t perform that action at this time.
0 commit comments