new(admin.gbapp): /publish now reads Can Publish from .gbot besides .env.
This commit is contained in:
parent
b11653c607
commit
f9ab5b3437
1 changed files with 14 additions and 6 deletions
|
@ -237,6 +237,7 @@ export class AdminDialog extends IGBDialog {
|
||||||
min.dialogs.add(
|
min.dialogs.add(
|
||||||
new WaterfallDialog('/publish', [
|
new WaterfallDialog('/publish', [
|
||||||
async step => {
|
async step => {
|
||||||
|
|
||||||
if (step.context.activity.channelId !== 'msteams' && process.env.ENABLE_AUTH) {
|
if (step.context.activity.channelId !== 'msteams' && process.env.ENABLE_AUTH) {
|
||||||
return await step.beginDialog('/auth');
|
return await step.beginDialog('/auth');
|
||||||
}
|
}
|
||||||
|
@ -351,7 +352,14 @@ export class AdminDialog extends IGBDialog {
|
||||||
*/
|
*/
|
||||||
public static canPublish(min: GBMinInstance, phone: string): Boolean {
|
public static canPublish(min: GBMinInstance, phone: string): Boolean {
|
||||||
if (process.env.SECURITY_CAN_PUBLISH !== undefined) {
|
if (process.env.SECURITY_CAN_PUBLISH !== undefined) {
|
||||||
const list = process.env.SECURITY_CAN_PUBLISH.split(';');
|
let list = process.env.SECURITY_CAN_PUBLISH.split(';');
|
||||||
|
|
||||||
|
const canPublish =
|
||||||
|
min.core.getParam(min.instance, 'Can Publish', null);
|
||||||
|
if (canPublish) {
|
||||||
|
list = list.concat(canPublish.split(';'));
|
||||||
|
}
|
||||||
|
|
||||||
let result = list.includes(phone);
|
let result = list.includes(phone);
|
||||||
|
|
||||||
if (!result && min.instance.params) {
|
if (!result && min.instance.params) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue