1
0
Fork 0
mirror of https://github.com/documize/community.git synced 2025-07-19 05:09:42 +02:00

Use default Ember object ID for permissions model

This commit is contained in:
McMatts 2018-04-26 12:03:23 +01:00
parent 962a8369aa
commit b40db1433e
2 changed files with 13 additions and 1 deletions

View file

@ -13,6 +13,7 @@ import { inject as service } from '@ember/service';
import { A } from "@ember/array" import { A } from "@ember/array"
import { debounce } from '@ember/runloop'; import { debounce } from '@ember/runloop';
import ModalMixin from '../../mixins/modal'; import ModalMixin from '../../mixins/modal';
import stringUtil from '../../utils/string';
import Component from '@ember/component'; import Component from '@ember/component';
export default Component.extend(ModalMixin, { export default Component.extend(ModalMixin, {
@ -80,6 +81,7 @@ export default Component.extend(ModalMixin, {
permissionRecord(who, whoId, name) { permissionRecord(who, whoId, name) {
let raw = { let raw = {
id: stringUtil.makeId(16),
orgId: this.get('folder.orgId'), orgId: this.get('folder.orgId'),
folderId: this.get('folder.id'), folderId: this.get('folder.id'),
whoId: whoId, whoId: whoId,

View file

@ -1,9 +1,19 @@
// Copyright 2016 Documize Inc. <legal@documize.com>. All rights reserved.
//
// This software (Documize Community Edition) is licensed under
// GNU AGPL v3 http://www.gnu.org/licenses/agpl-3.0.en.html
//
// You can operate outside the AGPL restrictions by purchasing
// Documize Enterprise Edition and obtaining a commercial license
// by contacting <sales@documize.com>.
//
// https://documize.com
import ApplicationSerializer from './application'; import ApplicationSerializer from './application';
export default ApplicationSerializer.extend({ export default ApplicationSerializer.extend({
normalize(modelClass, resourceHash) { normalize(modelClass, resourceHash) {
let id = '0'; let id = '0';
if (resourceHash.whoId) id = resourceHash.whoId;
if (resourceHash.id) id = resourceHash.id; if (resourceHash.id) id = resourceHash.id;
return { return {