Page 1 of 1

Unable to do Write operations using api

PostPosted:Mon Nov 28, 2022 10:03 am
by nishant8900
Hi,
In openkm 6.3 CE version that we are using.
https://docs.openkm.com/kcenter/view/ok ... agger.html
I can able to do read operation using API , can able to fetch folder's and its properties ,children folders etc.
but while doing Write operations like put ,create methods unable to do it. May be because of LDAP Connectivity.
But I'm not sure LDAP connectivity is the reason .if it is the reason kindly give some alternative solution or else give some suggestions.
And one more thing, unable to do the write operation using SCRIPTING TOOL in the openkm also.
This is the code we are tried to evaluate:
Code: Select all
import com.openkm.api.OKMAuth;

try {
     OKMAuth.getInstance().createRole(null, "ROLE_TEST", true);
 } catch (Exception e) {
     //  e.printStackTrace();
    print(e);
}
We are getting this kind of exception in both SCRIPTING TOOL and SWAGGER API
org.apache.commons.lang.NotImplementedException: createRole

Currently we are using LDAP principal adapter. and we are able to get the users from AD successfully.
Thanks.

Re: Unable to do Write operations using api

PostPosted:Mon Dec 05, 2022 12:43 pm
by jllort
Obviously, when OpenKM is integrated with AD you can only read data from the AD, you can not apply changes there ( otherwise you will have a security break in your AD ). All the changes must always be done from AD side, OpenKM is a slave reader.

Assign Role to the user - Mapping Roles to the user

PostPosted:Thu Dec 08, 2022 10:03 am
by nishant8900
Hi ,
First of all i will explain my logic

there are two types of roles and we will assume like
i)Lead - have all the access like (READ , WRITE , DELETE , SECURITY)
ii)User - have read only access.
important things is we are using LDAP.

because of LDAP we unable to mapping the roles to the users .
so , is there any programmatical way to achieve this?

kindly give the suggestion to this.

Thanks.

Re: Unable to do Write operations using api

PostPosted:Wed Dec 14, 2022 8:15 am
by jllort
1- One thing is a role ( for example ROLE_USER ) and another is the security grants ( READ, WRITE etc... ). For example in a openkm node like /okm:root/test.pdf can assign ROLE_USER with READ access and for /okm:root/test2.pdf assign ROLE_USER with READ and WRITE
2- About AD integration, in this scenario, the users and roles only can be managed from the AD. You can not modify the AD otherwise will be a security break.