mirror of
https://github.com/Cian-H/invenio-config-iform.git
synced 2026-01-06 20:11:57 +00:00
commented the overriden
uncomment to enable, also excluded some line of code from coverage.
This commit is contained in:
@@ -186,8 +186,8 @@ RECAPTCHA_PRIVATE_KEY = None
|
||||
# See:
|
||||
# https://invenio-records-permissions.readthedocs.io/en/latest/configuration.html
|
||||
#
|
||||
|
||||
RECORDS_PERMISSIONS_RECORD_POLICY = (
|
||||
'invenio_config_tugraz.permissions.TUGRAZPermissionPolicy'
|
||||
)
|
||||
# Uncomment these to enable overriden
|
||||
# RECORDS_PERMISSIONS_RECORD_POLICY = (
|
||||
# 'invenio_config_tugraz.permissions.TUGRAZPermissionPolicy'
|
||||
# )
|
||||
"""Access control configuration for records."""
|
||||
|
||||
@@ -207,8 +207,8 @@ class RecordIp(Generator):
|
||||
def check_permission(self):
|
||||
"""Check for User IP address in config variable."""
|
||||
# Get user IP
|
||||
user_ip = request.remote_addr
|
||||
user_ip = request.remote_addr # pragma: no cover
|
||||
# Checks if the user IP is among single IPs
|
||||
if user_ip in current_app.config['INVENIO_CONFIG_TUGRAZ_SINGLE_IP']:
|
||||
return True
|
||||
return False
|
||||
return True # pragma: no cover
|
||||
return False # pragma: no cover
|
||||
|
||||
Reference in New Issue
Block a user