Commit 8fc0005e authored by Martin Santangelo's avatar Martin Santangelo

(feat) force APPROVE_SUBSCRIBER in channel

......@@ -3,6 +3,8 @@ import { observable, action, extendObservable } from "mobx";
import api from "../../common/services/api.service";
import logService from "../../common/services/log.service";
import UserModel from "../UserModel";
import sessionService from "../../common/services/session.service";
import { FLAG_APPROVE_SUBSCRIBER } from "../../common/Permissions";
/**
* Subscription request store
......@@ -36,6 +38,11 @@ export default class SubscriptionRequestStore {
* @param {any} request
*/
async accept(request: any): Promise<void> {
if (!sessionService.getUser().can(FLAG_APPROVE_SUBSCRIBER, true)) {
return;
}
try {
this.setInProgress(request, true);
await api.put(
......@@ -54,6 +61,11 @@ export default class SubscriptionRequestStore {
* @param {any} request
*/
async decline(request: any): Promise<void> {
if (!sessionService.getUser().can(FLAG_APPROVE_SUBSCRIBER, true)) {
return;
}
try {
this.setInProgress(request, true);
await api.put(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment