Disable enabling apps by groups for filesystem, authentication and loggin apps

This commit is contained in:
Robin Appelman 2014-04-28 13:27:32 +02:00 committed by Thomas Müller
parent 402a31f196
commit 7e07ff6f4f
1 changed files with 28 additions and 17 deletions

View File

@ -89,6 +89,13 @@ OC.Settings.Apps = OC.Settings.Apps || {
page.find(".warning").hide();
}
page.find("div.multiselect").parent().remove();
if(OC.Settings.Apps.isType(app, 'filesystem') || OC.Settings.Apps.isType(app, 'prelogin') ||
OC.Settings.Apps.isType(app, 'authentication') || OC.Settings.Apps.isType(app, 'logging')) {
page.find("#groups_enable").hide();
page.find("label[for='groups_enable']").hide();
page.find("#groups_enable").attr('checked', null);
} else {
$('#group_select > option').each(function (i, el) {
if (app.groups.length === 0 || app.groups.indexOf(el.value) >= 0) {
$(el).attr('selected', 'selected');
@ -96,7 +103,6 @@ OC.Settings.Apps = OC.Settings.Apps || {
$(el).attr('selected', null);
}
});
page.find("div.multiselect").parent().remove();
if (app.active) {
if (app.groups.length) {
$('#group_select').multiSelect();
@ -110,6 +116,7 @@ OC.Settings.Apps = OC.Settings.Apps || {
page.find("#groups_enable").hide();
page.find("label[for='groups_enable']").hide();
}
}
},
enableApp:function(appid, active, element, groups) {
console.log('enableApp:', appid, active, element);
@ -271,6 +278,9 @@ OC.Settings.Apps = OC.Settings.Apps || {
showErrorMessage: function(message) {
$('.appinfo .warning').show();
$('.appinfo .warning').text(message);
},
isType: function(app, type){
return app.types && app.types.indexOf(type) !== -1;
}
};
@ -278,6 +288,7 @@ $(document).ready(function(){
$('#app-navigation ul li').each(function(index,li){
var app = OC.get('appData_'+$(li).data('id'));
if (app) {
console.log(app);
app.groups= $(li).data('groups') || [];
}
$(li).data('app',app);