Skip to content

Commit c7474c8

Browse files
chore: log matching roles
Signed-off-by: Andrew Lilley Brinker <abrinker@mitre.org>
1 parent 83c6e66 commit c7474c8

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

src/middleware/authz.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,15 @@ function orgHasRole (...roles) {
727727
uuid: req.ctx.uuid
728728
})
729729

730-
if (orgRoles.intersection(allowedRoles).size === 0) {
730+
const matchingRoles = orgRoles.intersection(allowedRoles)
731+
732+
logger.debug({
733+
message: 'found matching roles!',
734+
matchingRoles: Array.from(matchingRoles),
735+
uuid: req.ctx.uuid
736+
})
737+
738+
if (matchingRoles.size === 0) {
731739
logger.debug({ message: 'no matching roles found', uuid: req.ctx.uuid })
732740
return mwError.orgLacksRoles(req.ctx.org, roles)
733741
}

0 commit comments

Comments
 (0)