Merge pull request #4611 from martenson/respect-email-exposure

respect expose_user_email configuration in datalibraries permissions list
This commit is contained in:
Eric Rasche
2017-09-15 14:17:39 +02:00
committed by GitHub
10 changed files with 108 additions and 256 deletions
@@ -27,9 +27,9 @@ var LibraryDatasetView = Backbone.View.extend({
"click .toolbtn_cancel_modifications" : "render",
"click .toolbtn-download-dataset" : "downloadDataset",
"click .toolbtn-import-dataset" : "importIntoHistory",
"click .btn-copy-link-to-clipboard" : "copyToClipboard",
"click .btn-make-private" : "makeDatasetPrivate",
"click .btn-remove-restrictions" : "removeDatasetRestrictions",
"click .copy-link-to-clipboard" : "copyToClipboard",
"click .make-private" : "makeDatasetPrivate",
"click .remove-restrictions" : "removeDatasetRestrictions",
"click .toolbtn_save_permissions" : "savePermissions",
"click .toolbtn_save_modifications" : "saveModifications"
},
@@ -249,6 +249,8 @@ var LibraryDatasetView = Backbone.View.extend({
},
showPermissions: function(options){
var template = this.templateDatasetPermissions();
var self = this;
this.options = _.extend(this.options, options);
$(".tooltip").remove();
if (this.options.fetched_permissions !== undefined){
@@ -258,21 +260,14 @@ var LibraryDatasetView = Backbone.View.extend({
this.model.set({is_unrestricted:false});
}
}
// Select works different for admins, details in this.prepareSelectBoxes
var is_admin = false;
if (Galaxy.user){
is_admin = Galaxy.user.isAdmin();
}
var template = this.templateDatasetPermissions();
this.$el.html(template({item: this.model, is_admin: is_admin}));
var self = this;
this.$el.html(template({item: this.model, is_admin: Galaxy.config.is_admin_user}));
$.get(Galaxy.root + "api/libraries/datasets/" + self.id + "/permissions?scope=current")
.done(function(fetched_permissions) {
self.prepareSelectBoxes({fetched_permissions: fetched_permissions, is_admin: is_admin});
})
.fail(function(){
mod_toastr.error('An error occurred while attempting to fetch dataset permissions.');
});
.done(function(fetched_permissions){
self.prepareSelectBoxes({fetched_permissions: fetched_permissions, is_admin: Galaxy.config.is_admin_user});
})
.fail(function(){
mod_toastr.error('An error occurred while attempting to fetch dataset permissions.');
});
$("#center [data-toggle]").tooltip();
$("#center").css('overflow','auto');
},
@@ -287,171 +282,74 @@ var LibraryDatasetView = Backbone.View.extend({
prepareSelectBoxes: function(options){
this.options = _.extend(this.options, options);
var fetched_permissions = this.options.fetched_permissions;
var is_admin = this.options.is_admin
var self = this;
var selected_access_dataset_roles = [];
var selected_modify_item_roles = [];
var selected_manage_dataset_roles = [];
selected_access_dataset_roles = this._serializeRoles(fetched_permissions.access_dataset_roles);
selected_modify_item_roles = this._serializeRoles(fetched_permissions.modify_item_roles);
selected_manage_dataset_roles = this._serializeRoles(fetched_permissions.manage_dataset_roles);
this.accessSelectObject = new mod_select.View(
this._generate_select_options({
selector: 'access_perm',
initialData: this._serializeRoles(this.options.fetched_permissions.access_dataset_roles)
})
);
this.modifySelectObject = new mod_select.View(
this._generate_select_options({
selector: 'modify_perm',
initialData: this._serializeRoles(this.options.fetched_permissions.modify_item_roles)
})
);
this.manageSelectObject = new mod_select.View(
this._generate_select_options({
selector: 'manage_perm',
initialData: this._serializeRoles(this.options.fetched_permissions.manage_dataset_roles)
})
);
},
if (is_admin){ // Admin has a special select that allows AJAX searching
var access_select_options = {
minimumInputLength: 0,
css: 'access_perm',
multiple:true,
placeholder: 'Click to select a role',
container: self.$el.find('#access_perm'),
ajax: {
url: Galaxy.root + "api/libraries/datasets/" + self.id + "/permissions?scope=available",
dataType: 'json',
quietMillis: 100,
data: function (term, page) { // page is the one-based page number tracked by Select2
return {
q: term, //search term
page_limit: 10, // page size
page: page // page number
};
},
results: function (data, page) {
var more = (page * 10) < data.total; // whether or not there are more results available
// notice we return the value of more so Select2 knows if more results can be loaded
return {results: data.roles, more: more};
}
},
formatResult : function roleFormatResult(role) {
return role.name + ' type: ' + role.type;
},
formatSelection: function roleFormatSelection(role) {
return role.name;
},
initSelection: function(element, callback) {
// the input tag has a value attribute preloaded that points to a preselected role's id
// this function resolves that id attribute to an object that select2 can render
// using its formatResult renderer - that way the role name is shown preselected
var data = [];
$(element.val().split(",")).each(function() {
var item = this.split(':');
data.push({
id: item[0],
name: item[1]
});
_generate_select_options: function(options){
var select_options = {
minimumInputLength: 0,
multiple: true,
placeholder: 'Click to select a role',
formatResult : function roleFormatResult(role) {
return role.name + ' type: ' + role.type;
},
formatSelection: function roleFormatSelection(role) {
return role.name;
},
initSelection: function(element, callback) {
// the input tag has a value attribute preloaded that points to a preselected role's id
// this function resolves that id attribute to an object that select2 can render
// using its formatResult renderer - that way the role name is shown preselected
var data = [];
$(element.val().split(",")).each(function() {
var item = this.split(':');
data.push({
id: item[0],
name: item[1]
});
callback(data);
},
initialData: selected_access_dataset_roles.join(','),
dropdownCssClass: "bigdrop" // apply css that makes the dropdown taller
};
var modify_select_options = {
minimumInputLength: 0,
css: 'modify_perm',
multiple:true,
placeholder: 'Click to select a role',
container: self.$el.find('#modify_perm'),
ajax: {
url: Galaxy.root + "api/libraries/datasets/" + self.id + "/permissions?scope=available",
dataType: 'json',
quietMillis: 100,
data: function (term, page) { // page is the one-based page number tracked by Select2
return {
q: term, //search term
page_limit: 10, // page size
page: page // page number
};
},
results: function (data, page) {
var more = (page * 10) < data.total; // whether or not there are more results available
// notice we return the value of more so Select2 knows if more results can be loaded
return {results: data.roles, more: more};
}
},
formatResult : function roleFormatResult(role) {
return role.name + ' type: ' + role.type;
},
formatSelection: function roleFormatSelection(role) {
return role.name;
},
initSelection: function(element, callback) {
// the input tag has a value attribute preloaded that points to a preselected role's id
// this function resolves that id attribute to an object that select2 can render
// using its formatResult renderer - that way the role name is shown preselected
var data = [];
$(element.val().split(",")).each(function() {
var item = this.split(':');
data.push({
id: item[0],
name: item[1]
});
});
callback(data);
},
initialData: selected_modify_item_roles.join(','),
dropdownCssClass: "bigdrop" // apply css that makes the dropdown taller
};
var manage_select_options = {
minimumInputLength: 0,
css: 'manage_perm',
multiple:true,
placeholder: 'Click to select a role',
container: self.$el.find('#manage_perm'),
ajax: {
url: Galaxy.root + "api/libraries/datasets/" + self.id + "/permissions?scope=available",
dataType: 'json',
quietMillis: 100,
data: function (term, page) { // page is the one-based page number tracked by Select2
return {
q: term, //search term
page_limit: 10, // page size
page: page // page number
};
},
results: function (data, page) {
var more = (page * 10) < data.total; // whether or not there are more results available
// notice we return the value of more so Select2 knows if more results can be loaded
return {results: data.roles, more: more};
}
},
formatResult : function roleFormatResult(role) {
return role.name + ' type: ' + role.type;
},
formatSelection: function roleFormatSelection(role) {
return role.name;
},
initSelection: function(element, callback) {
// the input tag has a value attribute preloaded that points to a preselected role's id
// this function resolves that id attribute to an object that select2 can render
// using its formatResult renderer - that way the role name is shown preselected
var data = [];
$(element.val().split(",")).each(function() {
var item = this.split(':');
data.push({
id: item[0],
name: item[1]
});
});
callback(data);
},
initialData: selected_manage_dataset_roles.join(','),
dropdownCssClass: "bigdrop" // apply css that makes the dropdown taller
};
self.accessSelectObject = new mod_select.View(access_select_options);
self.modifySelectObject = new mod_select.View(modify_select_options);
self.manageSelectObject = new mod_select.View(manage_select_options);
} else { // Non-admins have select with pre-loaded options
var template = self.templateAccessSelect();
$.get( Galaxy.root + "api/libraries/datasets/" + self.id + "/permissions?scope=available", function( data ) {
$('.access_perm').html(template({options: data.roles}));
self.accessSelectObject = $('#access_select').select2();
}).fail(function() {
mod_toastr.error('An error occurred while attempting to fetch dataset permissions.');
});
});
callback(data);
},
dropdownCssClass: "bigdrop" // apply css that makes the dropdown taller
}
select_options.container = this.$el.find('#' + options.selector);
select_options.css = options.selector;
select_options.initialData = options.initialData.join(',');
select_options.ajax = {
url: Galaxy.root + "api/libraries/datasets/" + this.id + "/permissions?scope=available",
dataType: 'json',
quietMillis: 100,
data: function (term, page) { // page is the one-based page number tracked by Select2
return {
q: term, //search term
page_limit: 10, // page size, should be same as used in 'more' variable below
page: page // page number
};
},
results: function (data, page) {
var more = (page * 10) < data.total; // whether or not there are more results available
// notice we return the value of more so Select2 knows if more results can be loaded
return {results: data.roles, more: more};
}
}
return select_options;
},
/**
@@ -683,12 +581,8 @@ var LibraryDatasetView = Backbone.View.extend({
'</ol>',
'<% if (item.get("is_unrestricted")) { %>',
'<div class="alert alert-info">',
'This dataset is unrestricted so everybody can access it. Just share the URL of this page. ',
'<button data-toggle="tooltip" data-placement="top" title="Copy to clipboard" class="btn btn-default btn-copy-link-to-clipboard primary-button" type="button">',
'<span class="fa fa-clipboard"></span>',
'&nbsp;To Clipboard',
'</button> ',
'<div>',
'This dataset is unrestricted so everybody with the link can access it. Just share <span class="copy-link-to-clipboard"><a>this page</a></span>.',
'</div>',
'<% } %>',
@@ -1035,12 +929,6 @@ var LibraryDatasetView = Backbone.View.extend({
// CONTAINER START
'<div class="library_style_container">',
'<div id="library_toolbar">',
'<a href="#folders/<%- item.get("folder_id") %>">',
'<button data-toggle="tooltip" data-placement="top" title="Go back to containing folder" class="btn btn-default primary-button toolbar-item" type="button">',
'<span class="fa fa-folder-open-o"></span>',
'&nbsp;Containing Folder',
'</button>',
'</a>',
'<a href="#folders/<%- item.get("folder_id") %>/datasets/<%- item.id %>">',
'<button data-toggle="tooltip" data-placement="top" title="Go back to dataset" class="btn btn-default primary-button toolbar-item" type="button">',
'<span class="fa fa-file-o"></span>',
@@ -1078,24 +966,9 @@ var LibraryDatasetView = Backbone.View.extend({
'<h2>Dataset-related permissions</h2>',
'<div class="alert alert-warning">Changes made below will affect <strong>every</strong> library item that was created from this dataset and also every history this dataset is part of.</div>',
'<% if (!item.get("is_unrestricted")) { %>',
'<p>You can remove all access restrictions on this dataset. ',
'<button data-toggle="tooltip" data-placement="top" title="Everybody will be able to access the dataset." class="btn btn-default btn-remove-restrictions primary-button" type="button">',
'<span class="fa fa-globe"></span>',
'&nbsp;Remove restrictions',
'</button>',
'</p>',
'<p>You can <span class="remove-restrictions"><a>remove all access restrictions</a></span> on this dataset.</p>',
'<% } else { %>',
'This dataset is unrestricted so everybody can access it. Just share the URL of this page.',
'<button data-toggle="tooltip" data-placement="top" title="Copy to clipboard" class="btn btn-default btn-copy-link-to-clipboard primary-button" type="button">',
'<span class="fa fa-clipboard"></span>',
'&nbsp;To Clipboard',
'</button>',
'<p>You can make this dataset private to you. ',
'<button data-toggle="tooltip" data-placement="top" title="Only you will be able to access the dataset." class="btn btn-default btn-make-private primary-button" type="button">',
'<span class="fa fa-key"></span>',
'&nbsp;Make Private',
'</button>',
'</p>',
'<p>You can <span class="make-private"><a>make this dataset private</a></span> to you.</p>',
'<% } %>',
'<h4>Roles that can access the dataset</h4>',
'<div id="access_perm" class="access_perm roles-selection"></div>',
@@ -1137,19 +1010,7 @@ var LibraryDatasetView = Backbone.View.extend({
'</div>',
'</div>'
].join(''));
},
templateAccessSelect: function(){
return _.template([
'<select id="access_select" multiple>',
'<% _.each(options, function(option) { %>',
'<option value="<%- option.name %>"><%- option.name %></option>',
'<% }); %>',
'</select>'
].join(''));
}
});
return {
+18 -19
View File
@@ -238,20 +238,17 @@ class GalaxyRBACAgent(RBACAgent):
sharing roles and any public role (not private and not sharing).
"""
roles = []
if query is not None:
query = query.replace('_', '/_').replace('%', '/%').replace('/', '//')
if query not in [None, '']:
query = query.strip().replace('_', '/_').replace('%', '/%').replace('/', '//')
search_query = query + '%'
log.debug('search_query: ' + str(search_query))
else:
search_query = None
# Limit the query only to get the page needed
if page is not None and page_limit is not None:
paginated = True
limit = page * page_limit
else:
paginated = False
limit = None
total_count = None
if isinstance(item, self.model.Library) and self.library_is_public(item):
is_public_item = True
elif isinstance(item, self.model.Dataset) and self.dataset_is_public(item):
@@ -260,27 +257,30 @@ class GalaxyRBACAgent(RBACAgent):
is_public_item = True
else:
is_public_item = False
# For public items and for library access admins can choose from all roles
if trans.user_is_admin() and (is_public_item or is_library_access):
# Add all non-deleted roles that fit the query
db_query = trans.sa_session.query(trans.app.model.Role).filter(self.model.Role.table.c.deleted == false())
if query is not None:
# Admins can always choose from all non-deleted roles
if trans.user_is_admin() or trans.app.config.expose_user_email:
if trans.user_is_admin():
db_query = trans.sa_session.query(trans.app.model.Role).filter(self.model.Role.table.c.deleted == false())
else:
# User is not an admin but the configuration exposes all private roles to all users.
db_query = trans.sa_session.query(trans.app.model.Role) \
.filter(and_(self.model.Role.table.c.deleted == false(),
self.model.Role.table.c.type == self.model.Role.types.PRIVATE))
if search_query:
db_query = db_query.filter(self.model.Role.table.c.name.like(search_query, escape='/'))
total_count = db_query.count()
if paginated:
if limit is not None:
# Takes the least number of results from beginning that includes the requested page
roles = db_query.order_by(self.model.Role.table.c.name).limit(limit).all()
page_start = (page * page_limit) - page_limit
page_end = page_start + page_limit
if total_count < page_start:
if total_count < page_start + 1:
# Return empty list if there are less results than the requested position
roles = []
else:
roles = roles[page_start:page_end]
else:
roles = db_query.order_by(self.model.Role.table.c.name)
# Non-admin and public item
elif is_public_item:
# Add the current user's private role
@@ -291,8 +291,7 @@ class GalaxyRBACAgent(RBACAgent):
# Add all remaining non-private, non-sharing roles
for role in self._get_npns_roles(trans):
roles.append(role)
# User is not admin and item is not public
# User will see all the roles derived from the access roles on the item
# User will see all the roles derived from the access roles on the item
else:
# If item has roles associated with the access permission, we need to start with them.
access_roles = item.get_access_roles(trans)
@@ -105,34 +105,26 @@ class LibraryDatasetsController(BaseAPIController, UsesVisualizationMixin):
current_user_roles = trans.get_current_user_roles()
library_dataset = self.ld_manager.get(trans, managers_base.decode_id(self.app, encoded_dataset_id))
dataset = library_dataset.library_dataset_dataset_association.dataset
# User has to have manage permissions permission in order to see the roles.
can_manage = trans.app.security_agent.can_manage_dataset(current_user_roles, dataset) or trans.user_is_admin()
if not can_manage:
raise exceptions.InsufficientPermissionsException('You do not have proper permission to access permissions.')
scope = kwd.get('scope', None)
if scope == 'current' or scope is None:
if scope in ['current', None]:
return self._get_current_roles(trans, library_dataset)
# Return roles that are available to select.
elif scope == 'available':
elif scope in ['available']:
page = kwd.get('page', None)
if page is not None:
page = int(page)
else:
page = 1
page_limit = kwd.get('page_limit', None)
if page_limit is not None:
page_limit = int(page_limit)
else:
page_limit = 10
query = kwd.get('q', None)
roles, total_roles = trans.app.security_agent.get_valid_roles(trans, dataset, query, page, page_limit)
return_roles = []
for role in roles:
role_id = trans.security.encode_id(role.id)
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1,4 +1,4 @@
!function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var i=window.webpackJsonp;window.webpackJsonp=function(o,r){for(var a,l,u=0,c=[];u<o.length;u++)l=o[u],s[l]&&c.push.apply(c,s[l]),s[l]=0;for(a in r)Object.prototype.hasOwnProperty.call(r,a)&&(t[a]=r[a]);for(i&&i(o,r);c.length;)c.shift().call(null,e);if(r[0])return n[0]=0,e(0)};var n={},s={2:0};return e.e=function(t,i){if(0===s[t])return i.call(null,e);if(void 0!==s[t])s[t].push(i);else{s[t]=[i];var n=document.getElementsByTagName("head")[0],o=document.createElement("script");o.type="text/javascript",o.charset="utf-8",o.async=!0,o.src=e.p+""+t+"."+({3:"analysis",4:"admin",5:"login"}[t]||t)+".bundled.js",n.appendChild(o)}},e.m=t,e.c=n,e.p="",e(0)}([function(t,e,i){i(151),i(1),i(119),i(79),i(76),i(77),i(78),i(116),i(75),i(113),i(74),i(115),i(117),i(3),i(2),i(96),i(73),i(54),t.exports=i(150)},function(t,e,i){var n,s;/*!
!function(t){function e(i){if(n[i])return n[i].exports;var s=n[i]={exports:{},id:i,loaded:!1};return t[i].call(s.exports,s,s.exports,e),s.loaded=!0,s.exports}var i=window.webpackJsonp;window.webpackJsonp=function(o,r){for(var a,l,u=0,c=[];u<o.length;u++)l=o[u],s[l]&&c.push.apply(c,s[l]),s[l]=0;for(a in r)t[a]=r[a];for(i&&i(o,r);c.length;)c.shift().call(null,e);if(r[0])return n[0]=0,e(0)};var n={},s={2:0};return e.e=function(t,i){if(0===s[t])return i.call(null,e);if(void 0!==s[t])s[t].push(i);else{s[t]=[i];var n=document.getElementsByTagName("head")[0],o=document.createElement("script");o.type="text/javascript",o.charset="utf-8",o.async=!0,o.src=e.p+""+t+"."+({3:"analysis",4:"admin",5:"login"}[t]||t)+".bundled.js",n.appendChild(o)}},e.m=t,e.c=n,e.p="",e(0)}([function(t,e,i){i(151),i(1),i(119),i(79),i(76),i(77),i(78),i(116),i(75),i(113),i(74),i(115),i(117),i(3),i(2),i(96),i(73),i(54),t.exports=i(150)},function(t,e,i){var n,s;/*!
* jQuery JavaScript Library v1.12.4
* http://jquery.com/
*
File diff suppressed because one or more lines are too long
+1 -1
View File
@@ -1 +1 @@
{"version":3,"sources":["webpack:///login.bundled.js","webpack:///./galaxy/scripts/apps/login.js"],"names":["webpackJsonp","module","exports","__webpack_require__","Backbone","_","jQuery","$","GalaxyApp","_l","Page","window","app","options","bootstrapped","Galaxy","debug","redirect","encodeURI","show_welcome_with_login","params","param","use_panels","location","href","root","LoginPage","View","extend","initialize","page","this","model","Model","title","setElement","_template","render","prop","welcome_url","login_url","Right","call"],"mappings":"AAAAA,cAAc,IAER,SAAUC,EAAQC,EAASC,ICFjC,SAAAC,EAAAC,GAAA,GAAIC,GAASH,EAAS,GAClBI,EAAID,EACJE,EAAYL,EAAS,IAAWK,UAChCC,EAAKN,EAAS,GACdO,EAAOP,EAAS,GAEpBQ,QAAOC,IAAM,SAAcC,EAASC,GAChCH,OAAOI,OAAS,GAAIP,GAAWK,EAASC,GACxCC,OAAOC,MAAO,YACd,IAAIC,GAAWC,UAAWL,EAAQI,SAIlC,KAAKJ,EAAQM,wBAAyB,CAClC,GAAIC,GAASd,EAAOe,OAAQC,WAAa,OAAQL,SAAWA,GAE5D,aADAN,OAAOY,SAASC,KAAOT,OAAOU,KAAO,cAAgBL,GAIzD,GAAIM,GAAYtB,EAASuB,KAAKC,QAC1BC,WAAY,SAAUC,GAClBC,KAAKD,KAAOA,EACZC,KAAKC,MAAQ,GAAI5B,GAAS6B,OAAQC,MAAQzB,EAAI,oBAC9CsB,KAAKI,WAAYJ,KAAKK,cAE1BC,OAAQ,WACJN,KAAKD,KAAKvB,EAAG,gBAAiB+B,KAAM,MAAOzB,EAAQ0B,cAEvDH,UAAY,WACR,GAAII,GAAY3B,EAAQY,KAAO,cAAgBlB,EAAEc,OAASJ,SAAWA,GACrE,OAAO,gBAAkBuB,EAAY,2DAI7CjC,GAAE,WACEQ,OAAOe,KAAO,GAAIpB,GAAKiB,KAAMtB,EAAEuB,OAAQf,GACnC4B,MAAQf,UDQUgB,KAAKxC,EAASC,EAAoB,GAAIA,EAAoB","file":"login.bundled.js","sourcesContent":["webpackJsonp([5],[\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(Backbone, _) {var jQuery = __webpack_require__(1),\n\t $ = jQuery,\n\t GalaxyApp = __webpack_require__(52).GalaxyApp,\n\t _l = __webpack_require__(6),\n\t Page = __webpack_require__(53);\n\t\n\twindow.app = function app(options, bootstrapped) {\n\t window.Galaxy = new GalaxyApp(options, bootstrapped);\n\t Galaxy.debug('login app');\n\t var redirect = encodeURI(options.redirect);\n\t\n\t // TODO: remove iframe for user login (at least) and render login page from here\n\t // then remove this redirect\n\t if (!options.show_welcome_with_login) {\n\t var params = jQuery.param({ use_panels: 'True', redirect: redirect });\n\t window.location.href = Galaxy.root + 'user/login?' + params;\n\t return;\n\t }\n\t\n\t var LoginPage = Backbone.View.extend({\n\t initialize: function (page) {\n\t this.page = page;\n\t this.model = new Backbone.Model({ title: _l('Login required') });\n\t this.setElement(this._template());\n\t },\n\t render: function () {\n\t this.page.$('#galaxy_main').prop('src', options.welcome_url);\n\t },\n\t _template: function () {\n\t var login_url = options.root + 'user/login?' + $.param({ redirect: redirect });\n\t return '<iframe src=\"' + login_url + '\" frameborder=\"0\" style=\"width: 100%; height: 100%;\"/>';\n\t }\n\t });\n\t\n\t $(function () {\n\t Galaxy.page = new Page.View(_.extend(options, {\n\t Right: LoginPage\n\t }));\n\t });\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(3)))\n\n/***/ })\n]);\n\n\n// WEBPACK FOOTER //\n// login.bundled.js","var jQuery = require( 'jquery' ),\n $ = jQuery,\n GalaxyApp = require( 'galaxy' ).GalaxyApp,\n _l = require( 'utils/localization' ),\n Page = require( 'layout/page' );\n\nwindow.app = function app( options, bootstrapped ){\n window.Galaxy = new GalaxyApp( options, bootstrapped );\n Galaxy.debug( 'login app' );\n var redirect = encodeURI( options.redirect );\n\n // TODO: remove iframe for user login (at least) and render login page from here\n // then remove this redirect\n if( !options.show_welcome_with_login ){\n var params = jQuery.param({ use_panels : 'True', redirect : redirect });\n window.location.href = Galaxy.root + 'user/login?' + params;\n return;\n }\n\n var LoginPage = Backbone.View.extend({\n initialize: function( page ) {\n this.page = page;\n this.model = new Backbone.Model({ title : _l( 'Login required' ) } );\n this.setElement( this._template() );\n },\n render: function() {\n this.page.$( '#galaxy_main' ).prop( 'src', options.welcome_url );\n },\n _template : function() {\n var login_url = options.root + 'user/login?' + $.param( { redirect : redirect } );\n return '<iframe src=\"' + login_url + '\" frameborder=\"0\" style=\"width: 100%; height: 100%;\"/>';\n }\n });\n\n $(function(){\n Galaxy.page = new Page.View( _.extend( options, {\n Right : LoginPage\n } ) );\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/apps/login.js"],"sourceRoot":""}
{"version":3,"sources":["webpack:///login.bundled.js","webpack:///./galaxy/scripts/apps/login.js"],"names":["webpackJsonp","module","exports","__webpack_require__","Backbone","_","jQuery","$","GalaxyApp","_l","Page","window","app","options","bootstrapped","Galaxy","debug","redirect","encodeURI","show_welcome_with_login","params","param","use_panels","location","href","root","LoginPage","View","extend","initialize","page","this","model","Model","title","setElement","_template","render","prop","welcome_url","login_url","Right","call"],"mappings":"AAAAA,cAAc,IAER,SAASC,EAAQC,EAASC,ICFhC,SAAAC,EAAAC,GAAA,GAAIC,GAASH,EAAS,GAClBI,EAAID,EACJE,EAAYL,EAAS,IAAWK,UAChCC,EAAKN,EAAS,GACdO,EAAOP,EAAS,GAEpBQ,QAAOC,IAAM,SAAcC,EAASC,GAChCH,OAAOI,OAAS,GAAIP,GAAWK,EAASC,GACxCC,OAAOC,MAAO,YACd,IAAIC,GAAWC,UAAWL,EAAQI,SAIlC,KAAKJ,EAAQM,wBAAyB,CAClC,GAAIC,GAASd,EAAOe,OAAQC,WAAa,OAAQL,SAAWA,GAE5D,aADAN,OAAOY,SAASC,KAAOT,OAAOU,KAAO,cAAgBL,GAIzD,GAAIM,GAAYtB,EAASuB,KAAKC,QAC1BC,WAAY,SAAUC,GAClBC,KAAKD,KAAOA,EACZC,KAAKC,MAAQ,GAAI5B,GAAS6B,OAAQC,MAAQzB,EAAI,oBAC9CsB,KAAKI,WAAYJ,KAAKK,cAE1BC,OAAQ,WACJN,KAAKD,KAAKvB,EAAG,gBAAiB+B,KAAM,MAAOzB,EAAQ0B,cAEvDH,UAAY,WACR,GAAII,GAAY3B,EAAQY,KAAO,cAAgBlB,EAAEc,OAASJ,SAAWA,GACrE,OAAO,gBAAkBuB,EAAY,2DAI7CjC,GAAE,WACEQ,OAAOe,KAAO,GAAIpB,GAAKiB,KAAMtB,EAAEuB,OAAQf,GACnC4B,MAAQf,UDQUgB,KAAKxC,EAASC,EAAoB,GAAIA,EAAoB","file":"login.bundled.js","sourcesContent":["webpackJsonp([5],[\n/* 0 */\n/***/ function(module, exports, __webpack_require__) {\n\n\t/* WEBPACK VAR INJECTION */(function(Backbone, _) {var jQuery = __webpack_require__(1),\n\t $ = jQuery,\n\t GalaxyApp = __webpack_require__(52).GalaxyApp,\n\t _l = __webpack_require__(6),\n\t Page = __webpack_require__(53);\n\t\n\twindow.app = function app(options, bootstrapped) {\n\t window.Galaxy = new GalaxyApp(options, bootstrapped);\n\t Galaxy.debug('login app');\n\t var redirect = encodeURI(options.redirect);\n\t\n\t // TODO: remove iframe for user login (at least) and render login page from here\n\t // then remove this redirect\n\t if (!options.show_welcome_with_login) {\n\t var params = jQuery.param({ use_panels: 'True', redirect: redirect });\n\t window.location.href = Galaxy.root + 'user/login?' + params;\n\t return;\n\t }\n\t\n\t var LoginPage = Backbone.View.extend({\n\t initialize: function (page) {\n\t this.page = page;\n\t this.model = new Backbone.Model({ title: _l('Login required') });\n\t this.setElement(this._template());\n\t },\n\t render: function () {\n\t this.page.$('#galaxy_main').prop('src', options.welcome_url);\n\t },\n\t _template: function () {\n\t var login_url = options.root + 'user/login?' + $.param({ redirect: redirect });\n\t return '<iframe src=\"' + login_url + '\" frameborder=\"0\" style=\"width: 100%; height: 100%;\"/>';\n\t }\n\t });\n\t\n\t $(function () {\n\t Galaxy.page = new Page.View(_.extend(options, {\n\t Right: LoginPage\n\t }));\n\t });\n\t};\n\t/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(2), __webpack_require__(3)))\n\n/***/ }\n]);\n\n\n// WEBPACK FOOTER //\n// login.bundled.js","var jQuery = require( 'jquery' ),\n $ = jQuery,\n GalaxyApp = require( 'galaxy' ).GalaxyApp,\n _l = require( 'utils/localization' ),\n Page = require( 'layout/page' );\n\nwindow.app = function app( options, bootstrapped ){\n window.Galaxy = new GalaxyApp( options, bootstrapped );\n Galaxy.debug( 'login app' );\n var redirect = encodeURI( options.redirect );\n\n // TODO: remove iframe for user login (at least) and render login page from here\n // then remove this redirect\n if( !options.show_welcome_with_login ){\n var params = jQuery.param({ use_panels : 'True', redirect : redirect });\n window.location.href = Galaxy.root + 'user/login?' + params;\n return;\n }\n\n var LoginPage = Backbone.View.extend({\n initialize: function( page ) {\n this.page = page;\n this.model = new Backbone.Model({ title : _l( 'Login required' ) } );\n this.setElement( this._template() );\n },\n render: function() {\n this.page.$( '#galaxy_main' ).prop( 'src', options.welcome_url );\n },\n _template : function() {\n var login_url = options.root + 'user/login?' + $.param( { redirect : redirect } );\n return '<iframe src=\"' + login_url + '\" frameborder=\"0\" style=\"width: 100%; height: 100%;\"/>';\n }\n });\n\n $(function(){\n Galaxy.page = new Page.View( _.extend( options, {\n Right : LoginPage\n } ) );\n });\n};\n\n\n\n// WEBPACK FOOTER //\n// ./galaxy/scripts/apps/login.js"],"sourceRoot":""}
File diff suppressed because one or more lines are too long