Javascript app and wiki toolbar

LabKey Support Forum (Inactive)
Javascript app and wiki toolbar Anthony Corbett  2013-05-17 08:06
Status: Closed
 

Hi,

From my understanding being an Editor on a container allows them to edit anything in that container (wikis, lists, datasets, etc.) There is not a way, from my knowledge, to only be Editors on certain types of module's artifacts (the expcetion here being per dataset permissions).

Our group also has single page Javascript applications we embed into wiki pages. Our users also need insert/update to the study datasets so they all have the Editor role. However, for the same reason you are asking, we don't want them to edit/delete a wiki page. Our solution was to add a child container where the users are readers only and all javascript application wiki pages live in this child container. The down side with this approach is that all LABKEY.Query API calls must now explicitly set the containerPath to the parent container to correctly scope the query, and while this is annoying, we have a cross cutting layer which decorates all LABKEY.Query API calls to set this property across the whole application.

Another approach, if the users only need to insert new or edit THEIR OWN data, is to give them the Author role. This will remove the 'edit' and 'manage' buttons, but not the 'new' button. The downside is that they can only edit the records they have inserts and not records others have created, though depending on your use case this may be what you are looking for.


More of a hack is to place CSS in your wiki page to hide the buttons:

div.labkey-wp-text-buttons {
   visibility:hidden;
}

You can take this further and use javascript to check the user's role and apply the css style:

Ext.select('div.labkey-wp-text-buttons').setStyle('visibility', 'hidden');

Regards,

Anthony Corbett