netsuite-suitecloud-sdk icon indicating copy to clipboard operation
netsuite-suitecloud-sdk copied to clipboard

Import Custom Role and Custom Record Type Validation Error "Permission Mismatch"

Open aaron-ao-labs opened this issue 3 years ago • 0 comments

Your environment

OS : Windows 10 Node.js version : 16.15.0 suitecloud-cli version : 1.5.0 Terminal/CMD tool : cmd.exe

Describe the bug

When a Custom Role and Custom Record Type are imported via the suitecloud object:import -i command and then validated via suitecloud project:validate, an error is thrown that there is a permission mismatch. Even though, access to the record type is working as expected via this custom role through API / UI.

To Reproduce

Steps to reproduce the behavior:

  1. Create Custom Record Type with Access Type set to Use Permissions List
  2. Under Permissions subtab, add Custom Role with Level: Full
  3. Create Custom Record Field. Under Access subtab, add the Custom Role with Access Level: Edit and Level For Search/Reporting: Edit
  4. Navigate to the Custom Role. Under Permissions -> Custom Record subtab, add the Custom Record Type with Level: Full
  5. Import both objects via suitecloud object:import -i
  6. Run validation via suitecloud project:validate

Actual Behavior

Errors for file C:\Users\User\Documents\SuiteCloudProject\com.org.testapp\src\Objects\customrecord_test_record.xml.
    - Line No. 90 - Error Message: The permissions specified in the "customrecord_test_record" customrecordtype object do not match the permissions in the "customrole_test_role" role object.
Errors for file C:\Users\User\Documents\SuiteCloudProject\com.org.testapp\src\Objects\customrole_test_role.xml.
    - Line No. 110 - Error Message: The permissions specified in the "customrole_test_role" role object do not match the permissions in the "customrecord_test_record" customrecordtype object.

Expected Behavior

Validation should be successful.

Additional context

Below are the relevant XML entries.

customrole_test_role.xml

 <permission>
      <permkey>[scriptid=customrecord_test_record]</permkey>
      <permlevel>FULL</permlevel>
      <restriction></restriction>
    </permission>

customrecord_test_record.xml

<accesstype>USEPERMISSIONLIST</accesstype>
...
<customrecordcustomfields>
    <customrecordcustomfield scriptid="custrecord_test_field">
      <accesslevel>2</accesslevel>
      <rolerestrict>F</rolerestrict>
...
      <roleaccesses>
        <roleaccess>
          <accesslevel>2</accesslevel>
          <role>[scriptid=customrole_test_role]</role>
          <searchlevel>2</searchlevel>
        </roleaccess>
      </roleaccesses>
    </customrecordcustomfield>
  </customrecordcustomfields>
 <permissions>
    <permission>
      <permittedlevel>FULL</permittedlevel>
      <permittedrole>[scriptid=customrole_test_role]</permittedrole>
      <restriction></restriction>
    </permission>
  </permissions>

aaron-ao-labs avatar May 16 '22 16:05 aaron-ao-labs