Cuba Platform Error

Hi,

When I try to update an entity from anonymous user I have these errors:

ERROR c.h.cuba.core.sys.ServiceInterceptor -Exception in DataService.commit(..): com.haulmont.cuba.core.global.AccessDeniedException: ENTITY_OP:UPDATE myapp$Customer
12:36:17.122 ERROR com.haulmont.cuba.web.log.AppLog      
ERROR com.haulmont.cuba.web.log.AppLog  - Exception in com.haulmont.cuba.web.widgets.CubaButton: com.haulmont.cuba.core.global.AccessDeniedException: ENTITY_OP:UPDATE myapp$Customer

Where come from?
Did you make security modifications in Cuba platform?

Best Regards,
-n

Hi,
What is your CUBA version?

Hello Konstantin,

The platform is 7.1.4.
In order to access database before login I’ve set anonymous:standard. It works fine until couple weeks ago.
However in order to solve the problem I have to insert in SEC_PERMISSION (30.create-db.sql) and/or use addPermission() method in middleware.

Unfortunately I didn’t find any example with addPermission attributes and was very difficult to find an workaround.
For instance what should I set for extTarget? I let it blank" " and is fine…
Maybe you can explain a little bit how it works all these anonymous role stuff…

Thank You!
-n

You can set up the role in the app UI, select it in the table and click System Information in the context menu. Then click Script for insert. You will see all SQL statements needed to create the role with all its permissions, for example:

insert into SEC_ROLE 
(ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY, NAME, LOC_NAME, DESCRIPTION, ROLE_TYPE, IS_DEFAULT_ROLE) 
values ('fc63546b-167a-68be-4da6-738307d5e5c9', 1, '2020-03-17 18:43:43', 'admin', '2020-03-17 18:43:43', null, null, null, 'Users', null, null, 0, null);

insert into SEC_PERMISSION 
(ID, VERSION, CREATE_TS, CREATED_BY, UPDATE_TS, UPDATED_BY, DELETE_TS, DELETED_BY, PERMISSION_TYPE, TARGET, VALUE_, ROLE_ID) 
values ('625e7e21-effe-9db0-eef7-828e2c73eecb', 1, '2020-03-17 18:43:43', 'admin', '2020-03-17 18:43:43', null, null, null, 20, 'ref_Car:create', 1, 'fc63546b-167a-68be-4da6-738307d5e5c9');

...
1 Like