Esempio n. 1
0
RECORDS_REST_DEFAULT_UPDATE_PERMISSION_FACTORY = None
RECORDS_REST_DEFAULT_DELETE_PERMISSION_FACTORY = \
    'b2share.modules.records.permissions:DeleteRecordPermission'

B2ACCESS_APP_CREDENTIALS = dict(
    # B2ACCESS authentication key and secret
    consumer_key=os.environ.get("B2ACCESS_CONSUMER_KEY"),
    consumer_secret=os.environ.get("B2ACCESS_SECRET_KEY"),
)

B2ACCESS_BASE_URL = 'https://b2access.eudat.eu/'
if os.environ.get("USE_STAGING_B2ACCESS"):
    B2ACCESS_BASE_URL = 'https://unity.eudat-aai.fz-juelich.de/'

OAUTHCLIENT_REMOTE_APPS = dict(
    b2access=make_b2access_remote_app(B2ACCESS_BASE_URL))

# Don't let Invenio Accounts register Flask Security
ACCOUNTS_REGISTER_BLUEPRINT = False


ACCOUNTS_REST_ASSIGN_ROLE_PERMISSION_FACTORY = \
    'b2share.modules.users.permissions:RoleAssignPermission'
ACCOUNTS_REST_UNASSIGN_ROLE_PERMISSION_FACTORY = \
    'b2share.modules.users.permissions:RoleAssignPermission'
ACCOUNTS_REST_READ_ROLE_PERMISSION_FACTORY = authenticated_only
ACCOUNTS_REST_READ_ROLES_LIST_PERMISSION_FACTORY = authenticated_only

ACCOUNTS_REST_UPDATE_ROLE_PERMISSION_FACTORY = admin_only
ACCOUNTS_REST_DELETE_ROLE_PERMISSION_FACTORY = admin_only
ACCOUNTS_REST_CREATE_ROLE_PERMISSION_FACTORY = admin_only
Esempio n. 2
0
RECORDS_REST_DEFAULT_DELETE_PERMISSION_FACTORY = \
    'b2share.modules.records.permissions:DeleteRecordPermission'

B2ACCESS_APP_CREDENTIALS = dict(
    # B2ACCESS authentication key and secret
    consumer_key=os.environ.get("B2ACCESS_CONSUMER_KEY"),
    consumer_secret=os.environ.get("B2ACCESS_SECRET_KEY"),
)


B2ACCESS_BASE_URL = 'https://b2access.eudat.eu/'
if os.environ.get("USE_STAGING_B2ACCESS"):
    B2ACCESS_BASE_URL = 'https://unity.eudat-aai.fz-juelich.de/'

OAUTHCLIENT_REMOTE_APPS = dict(
    b2access=make_b2access_remote_app(B2ACCESS_BASE_URL)
)

# Don't let Invenio Accounts register Flask Security
ACCOUNTS_REGISTER_BLUEPRINT = False


ACCOUNTS_REST_ASSIGN_ROLE_PERMISSION_FACTORY = \
    'b2share.modules.users.permissions:RoleAssignPermission'
ACCOUNTS_REST_UNASSIGN_ROLE_PERMISSION_FACTORY = \
    'b2share.modules.users.permissions:RoleAssignPermission'
ACCOUNTS_REST_READ_ROLE_PERMISSION_FACTORY = authenticated_only
ACCOUNTS_REST_READ_ROLES_LIST_PERMISSION_FACTORY = authenticated_only

ACCOUNTS_REST_UPDATE_ROLE_PERMISSION_FACTORY = admin_only
ACCOUNTS_REST_DELETE_ROLE_PERMISSION_FACTORY = admin_only