Page 1 of 1

Howto use FolderService.list

Posted: Wed Feb 23, 2011 10:53 am
by real_skydiver
Hi there,

how can I use 'FolderService.list' if I don't know the root folder id? In my databse it is 5. If I use this (along with the proper sid) I get a nice list of folders with their id, parent id and name. Is it always '5'? Or is there a way to figure that id out?

Another question - 'AuthService.getGroups' delivers only the id, how can I get the name of that group?

Thanks!

Re: Howto use FolderService.list

Posted: Thu Feb 24, 2011 9:47 am
by agaspa
By default the root document folder in logicaldoc is 5.
By aware however that FolderService.list will return all the folders children of the folder you request, no matter the level.
We are introducing a new method that will be available shortly called FolderService.listChildren which will return only the children folder of the first level
About the groups you're right, actually there is no way to get the name of a group.
In version 6.0.2 there will be a new web-service called Security that will better manage security-related operations

Re: Howto use FolderService.list

Posted: Thu Feb 24, 2011 2:33 pm
by real_skydiver
Ok, my first demo app is done (see attached image). However, I found one 'feature' that I would declare as a bug: FolderService.list returns all folders, regardless of the security set. In my installation, I have several folders that only a certain user has access to (all other groups are removed from the security/access list). That works great in the browser: if I log on as a 'unprivileged' user the folders are simply not there. But using FolderService.list returns all folders for that 'unprivileged' user. It is not a good idea to burden security issues onto the client, that always should be the responsibility of the server.

Re: Howto use FolderService.list

Posted: Thu Feb 24, 2011 2:34 pm
by real_skydiver
Oh, btw., if anyone is interested in the source ... ;)

Re: Howto use FolderService.list

Posted: Thu Feb 24, 2011 3:53 pm
by agaspa
Hi skydiver,
thank you for reporting, I will pass it to our technical department for testing and if they found positive we will to correct ASAP the problem.

In the future, if you encounter bugs or you have new feature requests for extensions of web-services I recommend you to activate an account in the LogicalDOC Issue Tracking System.

Best regards
Alex

Re: Howto use FolderService.list

Posted: Thu Feb 24, 2011 4:10 pm
by agaspa
Ok Enrico,
I reported the problem and they gave me an answer.

The method in question returns all children, regardless of their level, but in order to be efficient returns all children, without checking the read permissions.
This is to have an efficient and fast method to create a tree.

In the next version of logicaldoc 6.0.2 there will be a new method even more efficient listChildren which will list only children at first level checking the read permissions.

Our engineers have confirmed however that this is not an error but merely an omission in the description of the method, this is because the possibility to read or write documents in a folder is checked when I try to execute these operations.

Re: Howto use FolderService.list

Posted: Thu Feb 24, 2011 4:11 pm
by real_skydiver
Hi Alex,

I wasn't really sure if it's a bug or intended.

Best regards,
Enrico

Re: Howto use FolderService.list

Posted: Thu Feb 24, 2011 5:32 pm
by real_skydiver
Hi Alex,

I don't want to start a discussion about this - since it will be 'fixed' with that new 'listChildren' methode. I just want to throw onto the table, that the idea
but in order to be efficient returns all children
is totally awkward, because actually the opposite is true. In order to write a application that reflects the access permissions - and everything else would not be acceptable by customers – you have to call ‘isReadable’ for every folder. Considering the SOAP-delay – that has a huge negative performance impact.

Just my two cents ;)

Best regards,
Enrico

Re: Howto use FolderService.list

Posted: Tue Apr 14, 2015 11:18 am
by shrikant
Hi All

Could we find the user's group and permitted folder id on basis of sid.

Regards
Shrikant