Page 1 of 1

how provide permissions to user

PostPosted:Fri Jun 15, 2012 10:12 am
by saileshkumard
how can i provide permissions to user to write or read or security or delete document or folder

i tried using below code but its not working plss help me
Code: Select all
public static void main(String[] args) {
		OKMAuthProxy authProxy = new OKMAuthProxy();
		authProxy.setEndpoint("http://localhost:8080/OpenKM/OKMAuth?wsdl");
		OKMFolderProxy folderProxy = new OKMFolderProxy();
		folderProxy.setEndpoint("http://localhost:8080/OpenKM/OKMFolder?wsdl");
		String path = "/okm:root/DOTNET/TestFolder6";
		try {
			String token = authProxy.login("okmAdmin", "admin");
			
			Folder newFolder = new Folder();
			newFolder.setPath(path);
			
			
			//folderProxy.create(token, newFolder);
			
			System.out.println("created");
			String strRoles[] = authProxy.getRoles(path);
			String strUsers[] = authProxy.getUsers(token);
			
			for (int i = 0; i < strUsers.length; i++) {
			authProxy.revokeUser(token, path, strUsers[i],1, false);
			authProxy.revokeUser(token, path, strUsers[i],2, false);
			authProxy.revokeUser(token, path, strUsers[i],4, false);
			}
			


Re: how provide permissions to user

PostPosted:Sat Jun 16, 2012 9:15 am
by jllort
Here you get all the methods
http://wiki.openkm.com/index.php/OKMAuth

And the possible values:
READ = 1;
WRITE = 2;
DELETE = 4;
SECURITY = 8;

For example read & write value is 3

Re: how provide permissions to user

PostPosted:Mon Jun 18, 2012 6:11 am
by saileshkumard
READ = 1;
WRITE = 2;
DELETE = 4;
SECURITY = 8;

i used this values but its working for roles not for user
please provide me example if possible

Re: how provide permissions to user

PostPosted:Wed Jun 20, 2012 10:28 am
by jllort
Is exactly the same but using grantUser method there's no mistery on it. Put here your code ( only the part involved on it ) and we will take a look.