ACL issue - current.group.manager returns undefined ?!?!?

Zod
Giga Guru

Hi,

I got a strange problem with some ACLs.

Only group managers should be able to 'write' for a specifig field on the sys_user group.

My ACL looks like this ... and should work. But it doesn't. Read ok, but write not. Log tells me, that "current.group.manager" is undefined. WHY???

There is a user set as Manager and I see absolutely no reason why this should not be ok.

Write access is also NOT given to the manger due to debug result .... ;-(

***

var answer = false; //Restrict access by default

gs.info("Manager: TEST " + current.group.manager );       // log shows undefined!!!

gs.info("User: TEST " + gs.getUserID());               // sys_id

if(gs.hasRole('user_admin') || gs.hasRole('u_support') || current.group.manager == gs.getUserID()){

      answer = true; //Allow access if user has 'user_admin' role or is group manager

}

1 ACCEPTED SOLUTION

nitish99
Tera Guru

Hi there,



On what table are you doing this?
If your table is SYS_USER_GROUP then you can check manager by current.manager instead of current.group.manager.


View solution in original post

5 REPLIES 5

Zod
Giga Guru

Strange also ... one other ACL where I use the same code ... current.group.manager returns 'empty' (i mean nothing ... and not 'undefined') in log ...


vikasmalhotra
Kilo Contributor

Hi,



Nothing seems wrong with the logic but still you can try as below:


find_real_file.png


It might help.



Hit like, helpful or correct if you find this useful.




Thanks!


Vikas


Siddartha Gudim
Tera Guru

If you are indicating to the current record assignment group manager, it should be



current.assignment_group.manager



I wonder if you have a field with value group. current.group is not valid.




Please like or mark correct based on the impact of response.


nitish99
Tera Guru

Hi there,



On what table are you doing this?
If your table is SYS_USER_GROUP then you can check manager by current.manager instead of current.group.manager.