Ver a proveniência

Add assets to campaigns' scopes if required.

master
Ben Kurtovic há 8 anos
ascendente
cometimento
fb4afca243
2 ficheiros alterados com 14 adições e 2 eliminações
  1. +2
    -2
      README.md
  2. +12
    -0
      calefaction/modules/campaigns/__init__.py

+ 2
- 2
README.md Ver ficheiro

@@ -20,9 +20,9 @@ Guide
cp config/config.yml.sample config/config.yml
vim config/config.yml # follow instructions
cat data/schema.sql | sqlite3 data/db.sqlite3
mkdir logs
mkdir logs templates/.cache
sudo chmod 0600 config/config.yml data/db.sqlite3
sudo chown www-data:www-data config/config.yml data data/db.sqlite3 logs
sudo chown www-data:www-data config/config.yml data data/db.sqlite3 logs templates/.cache
... # TODO: convert these into scripts, add SDE instructions, add module instructions

### Test


+ 12
- 0
calefaction/modules/campaigns/__init__.py Ver ficheiro

@@ -3,3 +3,15 @@
from .getters import get_current, get_overview, get_summary, get_unit
from .routes import home, navitem
from .._provided import config

def _get_scopes():
"""Determine the required scopes, depending on enabled operations."""
for cname in config["enabled"]:
campaign = config["campaigns"][cname]
for opname in campaign["enabled"]:
optype = campaign["operations"][opname]["type"]
if optype == "collection":
return {"esi-assets.read_assets.v1"}
return {}

SCOPES = _get_scopes()

Carregando…
Cancelar
Guardar