Hi Michele,
For restricting components there's currently no way to express that with the
annotations. To do it you need to implement a pre-registration-callback in your
area. For example:
[code]
@Area("left")
@Controller
@AvailableComponentClasses({TextComponent.class, BookCategoryComponent.class,
TwoColumnComponent.class})
public static class LeftArea {
@RequestMapping("/twoColumn/left")
public String render() {
return "components/leftArea.ftl";
}
@PreRegister
public void register(AreaDefinition areaDefinition) {
Map<String,ComponentAvailability> availableComponents =
areaDefinition.getAvailableComponents();
for (Map.Entry<String, ComponentAvailability> entry :
availableComponents.entrySet()) {
if (entry.getKey().equals("myModule:components/text"))
entry.getValue().getRoles().add("superuser");
}
}
}
[/code]
// Tobias
--
Context is everything:
http://forum.magnolia-cms.com/forum/thread.html?threadId=fc7bd63c-5ddb-4b6f-bfcc-048720e365ce
----------------------------------------------------------------
For list details, see http://www.magnolia-cms.com/community/mailing-lists.html
Alternatively, use our forums: http://forum.magnolia-cms.com/
To unsubscribe, E-mail to: <[email protected]>
----------------------------------------------------------------