Skip to content

Commit d860cc2

Browse files
committed
Issue 1560
1 parent 355a653 commit d860cc2

File tree

1 file changed

+3
-1
lines changed
  • src/components/ChallengeEditor/Resources

1 file changed

+3
-1
lines changed

src/components/ChallengeEditor/Resources/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,11 @@ export default class Resources extends React.Component {
183183
) {
184184
if (
185185
// Copilots can't delete themselves from the challenge
186+
// where the copilot has multiple roles, we should allow the additional roles to be deleted, but not the copilot role
186187
loggedInUserResource &&
187188
_.some(loggedInUserResource.roles, (role) => `${role}`.toLowerCase().indexOf('copilot') >= 0) &&
188-
loggedInUserResource.memberHandle === resourceItem.memberHandle
189+
loggedInUserResource.memberHandle === resourceItem.memberHandle &&
190+
`${resourceItem.role}`.toLowerCase().indexOf('copilot') >= 0
189191
) {
190192
exceptionResourceIdDeleteList[resourceItem.id] = true
191193
}

0 commit comments

Comments
 (0)