@esri/hub-discussions
Advanced tools
Comparing version 27.0.3 to 27.1.0
@@ -0,1 +1,2 @@ | ||
import { canReadChannel } from "../channels"; | ||
/** | ||
@@ -9,10 +10,7 @@ * Utility that determines whether a Channel allows a given PostReaction and whether the User has permissions to create it | ||
*/ | ||
export function canCreateReaction(channel, value | ||
// user: IUser | IDiscussionsUser = {} | ||
) { | ||
return channelAllowsReaction(channel, value); | ||
// if (!channelAllowsReaction(channel, value)) { | ||
// return false; | ||
// } | ||
// return canReadChannel(channel, user); | ||
export function canCreateReaction(channel, value, user = {}) { | ||
if (!channelAllowsReaction(channel, value)) { | ||
return false; | ||
} | ||
return canReadChannel(channel, user); | ||
} | ||
@@ -19,0 +17,0 @@ function channelAllowsReaction(channel, value) { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.canCreateReaction = void 0; | ||
const channels_1 = require("../channels"); | ||
/** | ||
@@ -12,10 +13,7 @@ * Utility that determines whether a Channel allows a given PostReaction and whether the User has permissions to create it | ||
*/ | ||
function canCreateReaction(channel, value | ||
// user: IUser | IDiscussionsUser = {} | ||
) { | ||
return channelAllowsReaction(channel, value); | ||
// if (!channelAllowsReaction(channel, value)) { | ||
// return false; | ||
// } | ||
// return canReadChannel(channel, user); | ||
function canCreateReaction(channel, value, user = {}) { | ||
if (!channelAllowsReaction(channel, value)) { | ||
return false; | ||
} | ||
return channels_1.canReadChannel(channel, user); | ||
} | ||
@@ -22,0 +20,0 @@ exports.canCreateReaction = canCreateReaction; |
@@ -1,2 +0,3 @@ | ||
import { PostReaction, IChannel } from "../../types"; | ||
import { IUser } from "@esri/arcgis-rest-auth"; | ||
import { PostReaction, IChannel, IDiscussionsUser } from "../../types"; | ||
/** | ||
@@ -10,2 +11,2 @@ * Utility that determines whether a Channel allows a given PostReaction and whether the User has permissions to create it | ||
*/ | ||
export declare function canCreateReaction(channel: IChannel, value: PostReaction): boolean; | ||
export declare function canCreateReaction(channel: IChannel, value: PostReaction, user?: IUser | IDiscussionsUser): boolean; |
{ | ||
"name": "@esri/hub-discussions", | ||
"version": "27.0.3", | ||
"version": "27.1.0", | ||
"description": "Module to interact with ArcGIS Hub Discussions API in Node.js and modern browsers.", | ||
@@ -5,0 +5,0 @@ "main": "dist/node/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
163892
2513