mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-02 07:27:04 +00:00
[API] share to admin permission
This commit is contained in:
@@ -3,8 +3,9 @@ define([
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common',
|
||||
'app/views/widgets/hl-item-view'
|
||||
], function($, _, Backbone, Common, HLItemView) {
|
||||
'app/views/widgets/hl-item-view',
|
||||
'app/views/share',
|
||||
], function($, _, Backbone, Common, HLItemView, ShareView) {
|
||||
'use strict';
|
||||
|
||||
var SharedRepoView = HLItemView.extend({
|
||||
@@ -14,13 +15,28 @@ define([
|
||||
mobileTemplate: _.template($('#shared-repo-mobile-tmpl').html()),
|
||||
|
||||
events: {
|
||||
'click .unshare-btn': 'removeShare'
|
||||
'click .unshare-btn': 'removeShare',
|
||||
'click .repo-share-btn': 'share',
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
HLItemView.prototype.initialize.call(this);
|
||||
},
|
||||
|
||||
share: function() {
|
||||
var options = {
|
||||
'is_repo_owner': true,
|
||||
'user_perm': 'rw',
|
||||
'repo_id': this.model.get('id'),
|
||||
'repo_encrypted': this.model.get('encrypted'),
|
||||
'is_dir': true,
|
||||
'dirent_path': '/',
|
||||
'obj_name': this.model.get('name')
|
||||
};
|
||||
new ShareView(options);
|
||||
return false;
|
||||
},
|
||||
|
||||
removeShare: function(e) {
|
||||
var _this = this,
|
||||
success_callback = function(data) {
|
||||
|
Reference in New Issue
Block a user