[deepamehta-devel] Creating Topics programmatically as part of Migrations

Jörg Richter jri at deepamehta.de
Mo Nov 26 15:40:51 CET 2012


On Nov 26, 2012, at 3:00, Malte Reißig wrote:

> So I can go with the way already implemented by dagnu, nice!
> 
> from line 524 on:
> https://github.com/dgf/dm4-mail/blob/4ecf81526239d2db1f01e34c7de2ce3b8b9518ff/src/main/java/de/deepamehta/plugins/mail/MailPlugin.java

Yes, exactly, this is the spot I had in mind.

One more hint: when constructing an AccessControlList you can specify more than one ACLEntry at once (one per Operation), and for each entry: you can specify more than one UserRole.
Example (AccessControlList for a type):

new AccessControlList(
	new ACLEntry(Operation.WRITE,  UserRole.CREATOR, UserRole.OWNER, UserRole.MEMBER),
	new ACLEntry(Operation.CREATE, UserRole.CREATOR, UserRole.OWNER, UserRole.MEMBER)
);

BTW: Operation.CREATE applies to types only.

> Which points me to another question; From the current dm4-weblcient
> perspective, would it be enough if I fix the ACL Entry just for  complex
> "parent" topic or do I need to fix the ACL Entries for all "simple"
> topics making up the complex too? The aim is: The complex, and (thus the
> simple topics) should be editable after my migration.

Generally it is sufficient to setup Access Control only at the parent topic.
The setup is virtually adopted by all the childs in the moment the parent is edited/updated.

However, if you want edit a child topic directly (by selecting it and then EDIT) the child topic needs an individual AC setup.

Cheers,
Jörg




Mehr Informationen über die Mailingliste devel