Skip to content

[WIP] Fix type error in enforce call - #89

Closed
mserico with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-enforce-typeerror-issue-again
Closed

[WIP] Fix type error in enforce call#89
mserico with Copilot wants to merge 1 commit into
masterfrom
copilot/fix-enforce-typeerror-issue-again

Conversation

Copilot AI commented Nov 30, 2025

Copy link
Copy Markdown
Contributor

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>Error resolving enforce : TypeError: data is not iterable</issue_title>
<issue_description>Hello,

I am receiving this error while issuing enforce call

Error resolving enforce : TypeError: data is not iterable
at EnforceSDK.enforce (C:\stage\cosmicgen\mS\iam\node_modules\casdoor-nodejs-sdk\lib\cjs\enforce.js:25:31)

Here is the code.

    const canRead = await sdk.enforce(
        'casbin/permission-built-in',
        'casbin/api-model-built-in', 
        '/casbin/u-7e995902/chat_juuni8/lin.jpg',
        "read"
    );

and the config is using
orgName: 'casbin',

Please contanct me at
slumarek01@gmail.com

Thank you</issue_description>

Comments on the Issue (you are @copilot in this section)

@hsluoyz need to refer to Casdoor Go SDK (https://github.com/casdoor/casdoor-go-sdk)'s code and test case code @hsluoyz The Node.js SDK code in this repo is very old. need to port the latest code from https://github.com/casdoor/casdoor-go-sdk to this code. the code should be exactly the same behavior, including source code and test cases

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error resolving enforce : TypeError: data is not iterable

3 participants