Search Function Based on Defined Roles with Features

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
2/11/2013 3:53:29 PM
Gravatar
Total Posts 4

Search Function Based on Defined Roles with Features

Need to know if this is possible. Starts to get a little involved with system fles. Allowing specific Roles to Search defined features. i.e. International Distributors (Role) can only search the Share Files feature.  

Here's what we're looking for in the code-see bold and I know where the search file is located: system files/_et.cfs but where do I define and how???

<select name="ctl00$mainContent$ddFeatureList" id="ctl00_mainContent_ddFeatureList" class="searchfeatures">

        <option selected="selected" value="00000000-0000-0000-0000-000000000000">All Content</option>

        <option value="881e4e00-93e4-444c-b7b0-6672fb55de10">Articles</option>

        <option value="026cbead-2b80-4491-906d-b83e37179ccf">Blogs</option>

        <option value="38aa5a84-9f5c-42eb-8f4c-105983d419fb">Forums</option>

        <option value="74bdbcc2-0e79-47ff-bcd4-a159270bf36e">List/Links</option>

        <option value="dc873d76-5bf2-4ac5-bff7-434a87a3fc8e">Shared Files</option>        Only this option should be available to Distributors for searching MSDSs

        <option value="d572f6b4-d0ed-465d-ad60-60433893b401">Image Galleries</option>

        <option value="c5e6a5df-ac2a-43d3-bb7f-9739bc47194e">Calendars</option>

        <option value="0cefbf18-56de-11dc-8f36-bac755d89593">Products</option>

 

</select>

 

2/11/2013 4:11:09 PM
Gravatar
Total Posts 18439

Re: Search Function Based on Defined Roles with Features

We don't have a way to limit that list per user or role. The search index in mojoPortal and the searchable features we ship all protect the search results according to the view roles of the page and the content instance. So users cannot find content that exists on pages for which they are not in allowed view roles according to the page settings. 

You can remove items from the dropdown but that would be for all users and it doesn't affect whether those features can be found in the search index, only role permissions of the content determine what can be found.

To remove features from the list you could add this to user.config:

<add key="SearchableFeatureGuidsToExclude" value=""/>

and populate it with a comma separate list of the feature guids you want to leave out. You can see the feature guid in the url when you search  a specific feature.

Hope that helps,

Joe

2/11/2013 4:18:51 PM
Gravatar
Total Posts 18439

Re: Search Function Based on Defined Roles with Features

So for example if you put an instance of Shared Files on a page protected by a role for International Distributors, then only users in the allowed role can find those files in search results. They might find files in other instance on other pages for which they do have permission or if not such pages exist they just won't get any results of that kind. The dropdown is just a filter for refining the search, what is shown in the list has nothing to do with what can be found, with no filter the shared files would still be found if they are on a page for which the user has view permission according to his roles.

Best,

Joe

2/12/2013 8:29:17 AM
Gravatar
Total Posts 4

Re: Search Function Based on Defined Roles with Features

Thanks Joe. Most helpful

You must sign in to post in the forums. This thread is closed to new posts.