tu-graz-library / invenio-config-tugraz

invenio module that adds tugraz configs.
MIT License
3 stars 9 forks source link

RecordIP generator #36

Closed mb-wali closed 3 years ago

mb-wali commented 3 years ago

RecordIp generator

To achieve this generator we had to create a new access_rights, of singleip. With the help of RDM_RECORDS_CUSTOM_VOCABULARIES. which then will be used by our RecordIp generator to define the needs and query_filter in order to give of decline access to the record based on given IPs in INVENIO_CONFIG_TUGRAZ_SINGLE_IP.

Steps to test this generator:

  1. Add your desired IPs to the: INVENIO_CONFIG_TUGRAZ_SINGLE_IP. for example - if we wish to test locally:
    INVENIO_CONFIG_TUGRAZ_SINGLE_IP = ["127.0.0.1"]
  2. Create a new record with the "access_right": "singleip".
  3. Test the visibility of the record. by changing the value: INVENIO_CONFIG_TUGRAZ_SINGLE_IP

Also, tests have been written for the RecordIP generator.

mb-wali commented 3 years ago

BUG

the record with the single IP is still accessible with the id: [https://domain/records/18aaj-nrt33]