Conditional Filters for Custom Code Block

There’s currently no option to add conditional filters to the custom-code block. The way I’ve been building out permissions is at the page level, I set the user group as either “admin” or “user”. Then at the block level, I specify:

logged-in user's company = "ABC COMPANY"

This allows us to scale the application out and use the same page and block setup for each client company and just update the conditional filter as needed.

Is there a code-based workaround to add conditional features to a custom-code block to achieve this?

Yes, there is a code-based workaround.

Please check out this thread:

This looks like it applies to form-blocks. Is there a way to apply it to a custom-code block?

Another workaround is, pass company name and the group name as url paramerter. And then it can be read by custom code.
In custom code, all the columns of User table is already present.

<script>
    document.addEventListener("DOMContentLoaded", function () {
        if(window.logged_in_user) {
            const logginInUserRecordId = window.logged_in_user.recordId;         
        }
    });
</script>

Oh interesting, I didn’t realize it loaded all columns of the user table, that’s helpful to know-thanks for the snippet!