Esempio n. 1
0
def get_restricted_collections():
    from invenio_access.control import acc_get_action_id
    from invenio_access.local_config import VIEWRESTRCOLL
    VIEWRESTRCOLL_ID = acc_get_action_id(VIEWRESTRCOLL)

    return [auth[0] for auth in AccAuthorization.query.join(
        AccAuthorization.argument
    ).filter(
        AccARGUMENT.keyword == 'collection',
        AccAuthorization.id_accACTION == VIEWRESTRCOLL_ID
    ).values(AccARGUMENT.value)]
Esempio n. 2
0
from invenio.utils.serializers import deserialize_via_marshal
from invenio_access.engine import acc_authorize_action
from invenio.ext.logging import register_exception
from invenio.utils.text import encode_for_xml, wash_for_utf8, strip_accents
from invenio.legacy import bibrecord

from invenio.legacy.dbquery import run_sql, run_sql_with_limit, \
    wash_table_column_name, get_table_update_time
from invenio.legacy.webuser import getUid, collect_user_info
from invenio.base.i18n import gettext_set_language

from invenio.utils import apache

from sqlalchemy.exc import DatabaseError

VIEWRESTRCOLL_ID = acc_get_action_id(VIEWRESTRCOLL)

# em possible values
EM_REPOSITORY={"body" : "B",
               "header" : "H",
               "footer" : "F",
               "search_box" : "S",
               "see_also_box" : "L",
               "basket" : "K",
               "alert" : "A",
               "search_info" : "I",
               "overview" : "O",
               "all_portalboxes" : "P",
               "te_portalbox" : "Pte",
               "tp_portalbox" : "Ptp",
               "np_portalbox" : "Pnp",