GlideElement.canWrite() dependend on table?

joek
Tera Expert

Hi Community!

I try to figure out why on my custom table which i extended from sn_customerservice_case and has no own ACLs on it following code is not working as i would expect:

var record = new GlideRecord('sn_customerservice_standard_case');
record.get('9e58ecc5dbd781904682e03cd3961973');
record;

record.state.canWrite() //returns false?


//same record but parent table used
var record = new GlideRecord('sn_customerservice_case');
record.get('9e58ecc5dbd781904682e03cd3961973');
record;

record.state.canWrite() //returns true

As i am using the same record i would assume that in both code-samples canWrite() would give me the same answer. 
Also i don't have any extra ACL on sn_customerservice_standard_case table defined, so as far as i know the ACLs from parent should be in place. 

Even also i use an admin user which should always canWrite()?

If i overlooked an ACL or anything else i would be thankful for the right direction.

Or is it a bug?

 

Thanks

1 ACCEPTED SOLUTION

joek
Tera Expert

To answer my own question: 
The reason why it was returning false on the custom table is, because canWrite() also evaluates the Dictionary Override for "Readonly". 

On the custom table there is a dictionary override defined readonly true and on the OOB sn_customerservice_case table its not.
If i remove the Readonly-Flag of the Dictionary Override for sn_customerservice_standard_case table the code also returns true.

But i still find it funny that its not the same and the dictionary override is only used when i define the GlideRecord on the sn_customerservice_standard_case table.

View solution in original post

3 REPLIES 3

Community Alums
Not applicable

Hi,

You will have to create ACLs for your custom extended table.

Mark my answer correct & Helpful, if Applicable.

Thanks,

Sandeep

But what if i don't want to create own custom acls for my table? I don't want to reimplement all the OOB ACL from the sn_customerservice_case table.

joek
Tera Expert

To answer my own question: 
The reason why it was returning false on the custom table is, because canWrite() also evaluates the Dictionary Override for "Readonly". 

On the custom table there is a dictionary override defined readonly true and on the OOB sn_customerservice_case table its not.
If i remove the Readonly-Flag of the Dictionary Override for sn_customerservice_standard_case table the code also returns true.

But i still find it funny that its not the same and the dictionary override is only used when i define the GlideRecord on the sn_customerservice_standard_case table.