cassproject / cass-editor

View, create, edit, modify frameworks using an easy to use, embeddable iframe.
https://cassproject.github.io/cass-editor/
Apache License 2.0
3 stars 11 forks source link

Wider Comparison for the isAdmin() Check #1363

Closed vbhayden closed 1 month ago

vbhayden commented 1 month ago

Updating the two isAdmin() functions to compare all public keys for the current user against all admin public keys provided by the ping.

The original check just looked at the first key in both, and the updated ping response will also include known users who have logged in as admins since the server process started.

This is a sister PR for https://github.com/cassproject/CASS/pull/320

sonarcloud[bot] commented 1 month ago

Quality Gate Failed Quality Gate failed

Failed conditions
100.0% Duplication on New Code (required ≤ 3%)

See analysis details on SonarCloud

vbhayden commented 1 month ago

The isAdmin() check in cassUtil.js seems to be unused, as that function didn't seem to do anything when changed. I can remove that block there to keep SonarCoud from complaining about duplication if requested.