Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Area Permissions on code-first Item

Area Permissions on code-first Item

Gheorghe Balan
Reply

Hi

I am trying to create items code-first, but I would like my item to be available only on one of my websites.

All the examples I could find mention the AreaRule attribute that is used to decorate a class - but this would give permission to all the websites in the installation to use that item.

I only want the item to be available on one of the websites in my solution. How can I do this code-first ?

Until further notice I decided to omit the AreaRule attribute altogether:

 

 [Item("AirconTeknikWebsiteSettings", "Custom website settings for aircon teknik")]
    [ModuleAttachmentRule(true),
     StructureRule(StructureContextType.Websites),
     ParentRule(ParentRestrictionRule.ParentType.RootOfWebsite),]

Br

Gheorghe


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Gheorghe,

Try with the overload that takes a sequence of area ids. Something like this...

[AreaRule(3)]

... where 3 is the id of the area (website) where this item type is allowed.

/Morten

 

You must be logged in to post in the forum