I have a custom list definition where I have defined a view with BaseViewID = 1
(AllItems.aspx)
<View BaseViewID="1" Type="HTML" WebPartZoneID="Main" DisplayName="$Resources:core,objectiv_schema_mwsidcamlidC24;" DefaultView="TRUE" MobileView="TRUE" MobileDefaultView="TRUE" SetupPath="pages\viewpage.aspx" ImageUrl="/_layouts/images/generic.png" Url="AllItems.aspx">
<Toolbar Type="Standard" />
<XslLink Default="TRUE">main.xsl</XslLink>
<RowLimit Paged="TRUE">30</RowLimit>
<ViewFields>
<FieldRef Name="Attachments"></FieldRef>
<FieldRef Name="LinkTitle"></FieldRef>
<FieldRef Name="Field1"></FieldRef>
<FieldRef Name="Field2"></FieldRef>
<FieldRef Name="Field3"></FieldRef>
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="ID"></FieldRef>
</OrderBy>
</Query>
<ParameterBindings>
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noXinviewofY_LIST)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noXinviewofY_DEFAULT)" />
</ParameterBindings>
</View>
I would like to customize this view by adding a query element. The query must return only items posted by users belonging to the group of the current user.
For example: user1 and user 2 are part of Group A while user 3 is part of Group B. If every user add an item both user1 and user 2 see two items while user3 only see one item.
Is it possible to define a query to achieve this result? if not, what are the options I can investigate?
Thanks very much
EDIT
I have followed the steps described in this post but unfortunately does not work
<Membership>
element in CAML. Or you can do an App (or wsp, if you don't mind using deprecated solutions).