Clean up whitelisted permission addition / logging.

pull/21833/head
Richard Lewis 2018-03-13 11:59:15 +00:00
parent 8b311c706c
commit 66ea78de65
1 changed files with 10 additions and 4 deletions

View File

@ -350,12 +350,18 @@ export default class AppTile extends React.Component {
requestedCapabilities = requestedCapabilities || [];
// Allow whitelisted capabilities
const requestedWhitelistCapabilies =
requestedCapabilities.filter(function(e) {
let requestedWhitelistCapabilies = [];
if (this.props.whitelistCapabilities && this.props.whitelistCapabilities.length > 0) {
requestedWhitelistCapabilies = requestedCapabilities.filter(function(e) {
return this.indexOf(e)>=0;
}, this.props.whitelistCapabilities);
console.warn(`Widget ${this.props.id} allowing requested, whitelisted properties:`,
requestedWhitelistCapabilies);
if (requestedWhitelistCapabilies.length > 0 ) {
console.warn(`Widget ${this.props.id} allowing requested, whitelisted properties:`,
requestedWhitelistCapabilies);
}
}
// TODO -- Add UI to warn about and optionally allow requested capabilities
this.setState({