Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get calls return item not found when the error is insufficient permission #341

Open
Senjai opened this issue Jul 13, 2017 · 3 comments
Open

Comments

@Senjai
Copy link
Contributor

Senjai commented Jul 13, 2017

Problem

When a user does not have permission to get a record, the gem reports an incorrect error

NetSuite::Records::CreditMemo.get(123) Will yield

NetSuite::RecordNotFound: NetSuite::Records::CreditMemo with OPTIONS={:internal_id=>123} could not be found

When the error via the logs is:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:
xsi="http://www.w3.org/2001/XMLSchema-instance">                                                                               
  <soapenv:Header>                                                                                                             
    <platformMsgs:documentInfo xmlns:platformMsgs="urn:messages_2016_2.platform.webservices.netsuite.com">                     
      <platformMsgs:nsId>WEBSERVICES_4548666_071320171044796155483003071_7fce118d7b34</platformMsgs:nsId>                      
    </platformMsgs:documentInfo>                                                                                               
  </soapenv:Header>                                                                                                            
  <soapenv:Body>                                                                                                               
    <getResponse xmlns="urn:messages_2016_2.platform.webservices.netsuite.com">                                                
      <readResponse>                                                                                                           
        <platformCore:status xmlns:platformCore="urn:core_2016_2.platform.webservices.netsuite.com" isSuccess="false">         
          <platformCore:statusDetail type="ERROR">                                                                             
            <platformCore:code>INSUFFICIENT_PERMISSION</platformCore:code>                                                     
            <platformCore:message>Permission Violation: You need  the 'Transactions -&gt; Credit Memo' permission to access thi
s page. Please contact your account administrator.</platformCore:message>                                                      
          </platformCore:statusDetail>                                                                                         
        </platformCore:status>                                                                                                 
      </readResponse>                                                                                                          
    </getResponse>                                                                                                             
  </soapenv:Body>                                                                                                              
</soapenv:Envelope>                                                                                                            

Expected Behavior

The gem raises a permission error instead.

@iloveitaly
Copy link
Member

@Senjai good catch! Would you mind submitting a PR to fix this bug?

@Senjai
Copy link
Contributor Author

Senjai commented Jul 17, 2017

@iloveitaly I'll try to find time to for sure. Can't promise anything immediate.

@Senjai
Copy link
Contributor Author

Senjai commented Feb 8, 2018

Hey @iloveitaly Just following up on this. I won't have time to patch it. Apologies :( If anyone else wants to take it fly at 'er

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

No branches or pull requests

2 participants