mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
re-working space permissions -- WIP
This commit is contained in:
parent
c51ba65b1d
commit
ae05cacf3f
37 changed files with 735 additions and 601 deletions
|
@ -48,8 +48,8 @@ export default Ember.Component.extend(NotifierMixin, TooltipMixin, AuthMixin, {
|
|||
this.addTooltip(document.getElementById("delete-documents-button"));
|
||||
} else {
|
||||
if (this.get('isFolderOwner')) {
|
||||
this.addTooltip(document.getElementById("folder-share-button"));
|
||||
this.addTooltip(document.getElementById("folder-settings-button"));
|
||||
this.addTooltip(document.getElementById("space-delete-button"));
|
||||
this.addTooltip(document.getElementById("space-settings-button"));
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
|
@ -23,7 +23,7 @@ export default Ember.Component.extend(NotifierMixin, {
|
|||
inviteMessage: '',
|
||||
|
||||
getDefaultInvitationMessage() {
|
||||
return "Hey there, I am sharing the " + this.folder.get('name') + " space (in " + this.get("appMeta.title") + ") with you so we can both access the same documents.";
|
||||
return "Hey there, I am sharing the " + this.folder.get('name') + " space (in " + this.get("appMeta.title") + ") with you so we can both collaborate on documents.";
|
||||
},
|
||||
|
||||
willRender() {
|
||||
|
@ -67,7 +67,8 @@ export default Ember.Component.extend(NotifierMixin, {
|
|||
this.set('inviteEmail', '');
|
||||
|
||||
this.get('folderService').share(this.folder.get('id'), result).then(() => {
|
||||
this.showNotification('Shared');
|
||||
this.showNotification('Invietd co-workers');
|
||||
$('#inviteEmail').removeClass('error');
|
||||
});
|
||||
}
|
||||
}
|
|
@ -32,13 +32,22 @@ export default Ember.Component.extend(NotifierMixin, {
|
|||
let isActive = user.get('active');
|
||||
|
||||
let u = {
|
||||
userId: user.get('id'),
|
||||
fullname: user.get('fullname'),
|
||||
orgId: this.get('folder.orgId'),
|
||||
folderId: this.get('folder.id'),
|
||||
canEdit: false,
|
||||
canView: false,
|
||||
canViewPrevious: false
|
||||
who: 'user',
|
||||
whoId: user.get('id'),
|
||||
location: 'space',
|
||||
scope: 'object',
|
||||
refId: this.get('folder.id'),
|
||||
spaceView: false,
|
||||
spaceManage: false,
|
||||
spaceOwner: false,
|
||||
docAdd: false,
|
||||
docEdit: false,
|
||||
docDelete: false,
|
||||
docMove: false,
|
||||
docCopy: false,
|
||||
docTemplate: false,
|
||||
};
|
||||
|
||||
if (isActive) {
|
||||
|
@ -47,13 +56,23 @@ export default Ember.Component.extend(NotifierMixin, {
|
|||
});
|
||||
|
||||
var u = {
|
||||
userId: "",
|
||||
fullname: " Everyone",
|
||||
orgId: this.get('folder.orgId'),
|
||||
folderId: this.get('folder.id'),
|
||||
canEdit: false,
|
||||
canView: false
|
||||
};
|
||||
who: 'user',
|
||||
whoId: '',
|
||||
location: 'space',
|
||||
scope: 'object',
|
||||
refId: this.get('folder.id'),
|
||||
spaceView: false,
|
||||
spaceManage: false,
|
||||
spaceOwner: false,
|
||||
docAdd: false,
|
||||
docEdit: false,
|
||||
docDelete: false,
|
||||
docMove: false,
|
||||
docCopy: false,
|
||||
docTemplate: false,
|
||||
};
|
||||
|
||||
folderPermissions.pushObject(u);
|
||||
|
||||
|
@ -111,6 +130,7 @@ export default Ember.Component.extend(NotifierMixin, {
|
|||
var payload = { Message: message, Roles: data };
|
||||
|
||||
this.get('folderService').savePermissions(folder.get('id'), payload).then(() => {
|
||||
this.showNotification('Saved permissions');
|
||||
});
|
||||
|
||||
var hasEveryone = _.find(data, function (permission) {
|
||||
|
@ -128,7 +148,6 @@ export default Ember.Component.extend(NotifierMixin, {
|
|||
}
|
||||
|
||||
this.get('folderService').save(folder).then(function () {
|
||||
// window.location.href = "/folder/" + folder.get('id') + "/" + folder.get('slug');
|
||||
});
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue