Question
· May 12

ERROR #5883: Item '%Test' is mapped from a database that you do not have write permission on

I have a local testing environment using VSCode.

I'm trying to create a routine %Test.mac, but keep getting permission error.

I have enabled write permissions to percent globals in the Admin Portal.

I'm connecting to Iris with superuser.

How do I give myself permissions?

Thanks

Product version: IRIS 2024.2
$ZV: IRIS for Windows (x86-64) 2024.2 (Build 247U) Tue Jul 16 2024 09:57:03 EDT
Discussion (5)2
Log in or sign up to continue

Every routine, class or global that start with "%" is mapped to a system database, usually "%SYS".

In your case %Test.mac is (by default) mapped to the %SYS database.

It seems that you (the user you connect to IRIS) don't have permissions to write to the %SYS database.

Please note that during IRIS upgrade all routines starting with "%" are DELETED, unless they start with %z or %Z, so I suggest to use a different name or, better, create your code in other namespace/database with consistent naming (package name) and map it from your application namespaces. If you need your code in all namespaces, create a mapping for the %ALL (pseudo) namespace.

It's not a permission issue!
A simple check tells you:

write ##class(%SYS.Namespace).GetRoutineDest(,"%Test") --> ^/opt/isc/icindy/mgr/irislib/

a routine named %Test will bes stored in the "irislib" database.
Now, if you take a look at the irislib database, you will see, it's a READONLY database, hence you get the <PROTECT> error. A readonly means read only, even for the Superuser!

If you absolutely need to name that routine with %-something (except %Z* and %z*) than:
- 1) remove the readonly flag from the database in question
  2) save your routine
  3) turn on the readonly flag
  4) for every change in that routine repeat the abowe game: 1), 2) and 3)
- and don't forget to make a copy of your %-something routine
  because each IRIS update REMOVES ALL %-routines except those %Z* and %z*