mirror of
https://github.com/vale981/Vulcan
synced 2025-03-06 01:51:40 -05:00
performCheck fix
This commit is contained in:
parent
2b4283ae43
commit
35a7904f92
6 changed files with 14 additions and 14 deletions
|
@ -30,7 +30,7 @@ const mutations = {
|
|||
|
||||
mutation(root, {document}, context) {
|
||||
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return newMutation({
|
||||
collection: context.Comments,
|
||||
|
@ -55,7 +55,7 @@ const mutations = {
|
|||
mutation(root, {documentId, set, unset}, context) {
|
||||
|
||||
const document = context.Comments.findOne(documentId);
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return editMutation({
|
||||
collection: context.Comments,
|
||||
|
@ -82,7 +82,7 @@ const mutations = {
|
|||
mutation(root, {documentId}, context) {
|
||||
|
||||
const document = context.Comments.findOne(documentId);
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return removeMutation({
|
||||
collection: context.Comments,
|
||||
|
|
|
@ -30,7 +30,7 @@ const mutations = {
|
|||
|
||||
mutation(root, {document}, context) {
|
||||
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return newMutation({
|
||||
collection: context.Pics,
|
||||
|
@ -55,7 +55,7 @@ const mutations = {
|
|||
mutation(root, {documentId, set, unset}, context) {
|
||||
|
||||
const document = context.Pics.findOne(documentId);
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return editMutation({
|
||||
collection: context.Pics,
|
||||
|
@ -82,7 +82,7 @@ const mutations = {
|
|||
mutation(root, {documentId}, context) {
|
||||
|
||||
const document = context.Pics.findOne(documentId);
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return removeMutation({
|
||||
collection: context.Pics,
|
||||
|
|
|
@ -30,7 +30,7 @@ const mutations = {
|
|||
|
||||
mutation(root, {document}, context) {
|
||||
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return newMutation({
|
||||
collection: context.Movies,
|
||||
|
@ -55,7 +55,7 @@ const mutations = {
|
|||
mutation(root, {documentId, set, unset}, context) {
|
||||
|
||||
const document = context.Movies.findOne(documentId);
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return editMutation({
|
||||
collection: context.Movies,
|
||||
|
@ -82,7 +82,7 @@ const mutations = {
|
|||
mutation(root, {documentId}, context) {
|
||||
|
||||
const document = context.Movies.findOne(documentId);
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return removeMutation({
|
||||
collection: context.Movies,
|
||||
|
|
|
@ -23,7 +23,7 @@ class App extends PureComponent {
|
|||
render() {
|
||||
return (
|
||||
<IntlProvider locale={this.getLocale()} messages={Strings[this.getLocale()]}>
|
||||
<Components.Layout>
|
||||
<Components.Layout {...this.props} >
|
||||
{ this.props.currentUserLoading ? <Components.Loading /> : this.props.children }
|
||||
</Components.Layout>
|
||||
</IntlProvider>
|
||||
|
|
|
@ -459,7 +459,7 @@ Utils.performCheck = (operation, user, checkedObject, context, documentId) => {
|
|||
throw new Error(Utils.encodeIntlError({id: `app.document_not_found`, value: documentId}))
|
||||
}
|
||||
|
||||
if (!operation.check(user, checkedObject, context)) {
|
||||
if (!operation(user, checkedObject, context)) {
|
||||
throw new Error(Utils.encodeIntlError({id: `app.operation_not_allowed`, value: operation.name}));
|
||||
}
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ const mutations = {
|
|||
|
||||
mutation(root, {document}, context) {
|
||||
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return newMutation({
|
||||
collection: context.Posts,
|
||||
|
@ -40,7 +40,7 @@ const mutations = {
|
|||
mutation(root, {documentId, set, unset}, context) {
|
||||
|
||||
const document = context.Posts.findOne(documentId);
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return editMutation({
|
||||
collection: context.Posts,
|
||||
|
@ -67,7 +67,7 @@ const mutations = {
|
|||
mutation(root, {documentId}, context) {
|
||||
|
||||
const document = context.Posts.findOne(documentId);
|
||||
Utils.performCheck(this, context.currentUser, document);
|
||||
Utils.performCheck(this.check, context.currentUser, document);
|
||||
|
||||
return removeMutation({
|
||||
collection: context.Posts,
|
||||
|
|
Loading…
Add table
Reference in a new issue