If I have a custom content type (IContentType and iContent) that also implements iSearchableContent, is there a method that would restrict search results based on the user conducting the search?
If I have a custom content type (IContentType and iContent) that also implements iSearchableContent, is there a method that would restrict search results based on the user conducting the search?
Search can only be restricted by security, which is what ISearchableContentType.GetViewSecurityRoles(contentId) is for. This method defines all the roles that can "view" content, and when a user searches the results are pruned based on their roles compared to the roles defined there, which are stored in the index.
So...if I had content that was for a "pay site" some is free and some is behind the wall...each object with a specific ContentId could determine which platform role is required to view it? Say I just had one role called "Subscriber" could I apply it to a few content items, and the others would basically be "Everyone"
Theoretically yes, for a given contentId you could return what roles could view it. But that is inconsistent with how actual security is going to work everywhere else since in the site individual items are not secured.
Theoretically yes, for a given contentId you could return what roles could view it. But that is inconsistent with how actual security is going to work everywhere else since in the site individual items are not secured.