uuid_regex = settings.UUID_REGEX urlpatterns = [ url(r"^$", main.index, name="root"), url(r"^index.htm", main.index, name="home"), url(r"^auth/password$", ChangePasswordView.as_view(), name="change_password"), url(r"^auth/signup$", SignupView.as_view(), name="signup"), url(r"^auth/confirm_signup$", ConfirmSignupView.as_view(), name="confirm_signup"), url(r"^auth/get_client_id$", GetClientIdView.as_view(), name="get_client_id"), url(r"^auth/user_profile$", UserProfileView.as_view(), name="user_profile"), url(r"^auth/server_settings$", ServerSettingView.as_view(), name="server_settings"), url(r"^auth/get_dev_token$", Token.as_view(), name="get_dev_token"), url(r"^auth/", LoginView.as_view(), name="auth"), url(r"^rdm/(?P<conceptid>%s|())$" % uuid_regex, RDMView.as_view(), name="rdm"), url(r"^admin/reindex/resources$", ReIndexResources.as_view(), name="reindex"), url(r"^files/(?P<fileid>%s)$" % uuid_regex, FileView.as_view(), name="file_access"), url(r"^concepts/(?P<conceptid>%s)/manage_parents/$" % uuid_regex, concept.manage_parents, name="concept_manage_parents"), url(r"^concepts/(?P<conceptid>%s)/confirm_delete/$" % uuid_regex, concept.confirm_delete, name="confirm_delete"), url(r"^concepts/(?P<conceptid>%s)/make_collection/$" % uuid_regex, concept.make_collection, name="make_collection"), url(r"^concepts/(?P<conceptid>%s|())$" % uuid_regex, concept.concept, name="concept"), url(r"^concepts/tree/(?P<mode>.*)", concept.concept_tree, name="concept_tree"), url(r"^concepts/search$", concept.search, name="concept_search"), url( r"^concepts/(?P<conceptid>%s)/from_sparql_endpoint$" % uuid_regex, concept.add_concepts_from_sparql_endpoint, name="from_sparql_endpoint", ), url(r"^concepts/search_sparql_endpoint$", concept.search_sparql_endpoint_for_concepts, name="search_sparql_endpoint"), url(r"^concepts/dropdown", concept.dropdown, name="dropdown"),
from django.contrib import admin admin.autodiscover() uuid_regex = settings.UUID_REGEX urlpatterns = [ url(r'^$', main.index, name='root'), url(r'^index.htm', main.index, name='home'), url(r'^auth/password$', ChangePasswordView.as_view(), name='change_password'), url(r'^auth/signup$', SignupView.as_view(), name='signup'), url(r'^auth/confirm_signup$', ConfirmSignupView.as_view(), name='confirm_signup'), url(r'^auth/get_token$', GetTokenView.as_view(), name='get_token'), url(r'^auth/get_client_id$', GetClientIdView.as_view(), name='get_client_id'), url(r'^auth/user_profile$', UserProfileView.as_view(), name='user_profile'), url(r'^auth/', LoginView.as_view(), name='auth'), url(r'^rdm/(?P<conceptid>%s|())$' % uuid_regex , RDMView.as_view(), name='rdm'), url(r'^admin/reindex/resources$', ReIndexResources.as_view(), name="reindex"), url(r'^concepts/(?P<conceptid>%s)/manage_parents/$' % uuid_regex, concept.manage_parents, name="concept_manage_parents"), url(r'^concepts/(?P<conceptid>%s)/confirm_delete/$' % uuid_regex, concept.confirm_delete, name="confirm_delete"), url(r'^concepts/(?P<conceptid>%s)/make_collection/$' % uuid_regex, concept.make_collection, name="make_collection"), url(r'^concepts/(?P<conceptid>%s|())$' % uuid_regex , concept.concept, name="concept"), url(r'^concepts/tree/(?P<mode>.*)', concept.concept_tree, name="concept_tree"), url(r'^concepts/search$', concept.search, name="concept_search"), url(r'^concepts/(?P<conceptid>%s)/from_sparql_endpoint$' % uuid_regex, concept.add_concepts_from_sparql_endpoint, name="from_sparql_endpoint"), url(r'^concepts/search_sparql_endpoint$', concept.search_sparql_endpoint_for_concepts, name="search_sparql_endpoint"), url(r'^concepts/dropdown', concept.dropdown, name="dropdown"), url(r'^concepts/paged_dropdown', concept.paged_dropdown, name="paged_dropdown"), url(r'^concepts/export/(?P<conceptid>%s)$' % uuid_regex , concept.export, name="export_concept"), url(r'^concepts/export/collections', concept.export_collections, name="export_concept_collections"), url(r'^concepts/collections', concept.get_concept_collections, name="get_concept_collections"), url(r'^concepts/get_pref_label', concept.get_pref_label, name="get_pref_label"),
url(r'^auth/password$', ChangePasswordView.as_view(), name='change_password'), url(r'^auth/signup$', SignupView.as_view(), name='signup'), url(r'^auth/confirm_signup$', ConfirmSignupView.as_view(), name='confirm_signup'), url(r'^auth/get_token$', GetTokenView.as_view(), name='get_token'), url(r'^auth/get_client_id$', GetClientIdView.as_view(), name='get_client_id'), url(r'^auth/user_profile$', UserProfileView.as_view(), name='user_profile'), url(r'^auth/', LoginView.as_view(), name='auth'), url(r'^rdm/(?P<conceptid>%s|())$' % uuid_regex, RDMView.as_view(), name='rdm'), url(r'^admin/reindex/resources$', ReIndexResources.as_view(), name="reindex"), url(r'^concepts/(?P<conceptid>%s)/manage_parents/$' % uuid_regex, concept.manage_parents, name="concept_manage_parents"), url(r'^concepts/(?P<conceptid>%s)/confirm_delete/$' % uuid_regex, concept.confirm_delete, name="confirm_delete"), url(r'^concepts/(?P<conceptid>%s)/make_collection/$' % uuid_regex, concept.make_collection, name="make_collection"), url(r'^concepts/(?P<conceptid>%s|())$' % uuid_regex, concept.concept,
from arches.app.utils.forms import ArchesSetPasswordForm # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover() uuid_regex = '[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}' urlpatterns = [ url(r'^$', main.index, name='root'), url(r'^index.htm', main.index, name='home'), url(r'^auth/password$', ChangePasswordView.as_view(), name='change_password'), url(r'^auth/signup$', SignupView.as_view(), name='signup'), url(r'^auth/confirm_signup$', ConfirmSignupView.as_view(), name='confirm_signup'), url(r'^auth/get_token$', GetTokenView.as_view(), name='get_token'), url(r'^auth/', LoginView.as_view(), name='auth'), url(r'^rdm/(?P<conceptid>%s|())$' % uuid_regex , RDMView.as_view(), name='rdm'), url(r'^admin/reindex/resources$', ReIndexResources.as_view(), name="reindex"), url(r'^concepts/(?P<conceptid>%s)/manage_parents/$' % uuid_regex, concept.manage_parents, name="concept_manage_parents"), url(r'^concepts/(?P<conceptid>%s)/confirm_delete/$' % uuid_regex, concept.confirm_delete, name="confirm_delete"), url(r'^concepts/(?P<conceptid>%s)/make_collection/$' % uuid_regex, concept.make_collection, name="make_collection"), url(r'^concepts/(?P<conceptid>%s|())$' % uuid_regex , concept.concept, name="concept"), url(r'^concepts/tree/(?P<mode>.*)', concept.concept_tree, name="concept_tree"), url(r'^concepts/search$', concept.search, name="concept_search"), url(r'^concepts/(?P<conceptid>%s)/from_sparql_endpoint$' % uuid_regex, concept.add_concepts_from_sparql_endpoint, name="from_sparql_endpoint"), url(r'^concepts/search_sparql_endpoint$', concept.search_sparql_endpoint_for_concepts, name="search_sparql_endpoint"), url(r'^concepts/dropdown', concept.dropdown, name="dropdown"), url(r'^concepts/paged_dropdown', concept.paged_dropdown, name="paged_dropdown"), url(r'^concepts/export/(?P<conceptid>%s)$' % uuid_regex , concept.export, name="export_concept"), url(r'^concepts/export/collections', concept.export_collections, name="export_concept_collections"), url(r'^concepts/get_pref_label', concept.get_pref_label, name="get_pref_label"), url(r'^conceptvalue/', concept.concept_value, name="concept_value"),
def test_nonauth_user_access_to_RDM(self): """ Test to check that a non-authenticated user can't access the RDM page, or POST data to the url """ request = self.factory.get(reverse('rdm', args=[''])) request.user = AnonymousUser() apply_middleware(request) view = RDMView.as_view() response = view(request) self.assertTrue(response.status_code == 302) self.assertTrue( response.get('location').split('?')[0] == reverse('auth')) # test get a concept request = self.factory.get( reverse( 'rdm', kwargs={'conceptid': '00000000-0000-0000-0000-000000000001'})) request.user = AnonymousUser() apply_middleware(request) view = RDMView.as_view() response = view(request) self.assertTrue(response.status_code == 302) self.assertTrue( response.get('location').split('?')[0] == reverse('auth')) # test update a concept concept = { "id": "00000000-0000-0000-0000-000000000001", "legacyoid": "ARCHES", "nodetype": "ConceptScheme", "values": [], "subconcepts": [{ "values": [{ "value": "test label", "language": "en-US", "category": "label", "type": "prefLabel", "id": "", "conceptid": "" }, { "value": "", "language": "en-US", "category": "note", "type": "scopeNote", "id": "", "conceptid": "" }], "relationshiptype": "hasTopConcept", "nodetype": "Concept", "id": "", "legacyoid": "", "subconcepts": [], "parentconcepts": [], "relatedconcepts": [] }] } request = self.factory.post( reverse( 'rdm', kwargs={'conceptid': '00000000-0000-0000-0000-000000000001'}), concept) request.user = AnonymousUser() apply_middleware(request) view = RDMView.as_view() response = view(request) self.assertTrue(response.status_code == 302) self.assertTrue( response.get('location').split('?')[0] == reverse('auth'))
def test_nonauth_user_access_to_RDM(self): """ Test to check that a non-authenticated user can't access the RDM page, or POST data to the url """ request = self.factory.get(reverse('rdm', args=[''])) request.user = AnonymousUser() apply_middleware(request) view = RDMView.as_view() response = view(request) self.assertTrue(response.status_code == 302) self.assertTrue(response.get('location').split('?')[0] == reverse('auth')) # test get a concept request = self.factory.get(reverse('rdm', kwargs={'conceptid':'00000000-0000-0000-0000-000000000001'})) request.user = AnonymousUser() apply_middleware(request) view = RDMView.as_view() response = view(request) self.assertTrue(response.status_code == 302) self.assertTrue(response.get('location').split('?')[0] == reverse('auth')) # test update a concept concept ={ "id": "00000000-0000-0000-0000-000000000001", "legacyoid": "ARCHES", "nodetype": "ConceptScheme", "values": [], "subconcepts": [{ "values": [{ "value": "test label", "language": "en-US", "category": "label", "type": "prefLabel", "id": "", "conceptid": "" },{ "value": "", "language": "en-US", "category": "note", "type": "scopeNote", "id": "", "conceptid": "" }], "relationshiptype": "hasTopConcept", "nodetype": "Concept", "id": "", "legacyoid": "", "subconcepts": [], "parentconcepts": [], "relatedconcepts": [] }] } request = self.factory.post(reverse('rdm', kwargs={'conceptid':'00000000-0000-0000-0000-000000000001'}), concept) request.user = AnonymousUser() apply_middleware(request) view = RDMView.as_view() response = view(request) self.assertTrue(response.status_code == 302) self.assertTrue(response.get('location').split('?')[0] == reverse('auth'))
''' ARCHES - a program developed to inventory and manage immovable cultural heritage. Copyright (C) 2013 J. Paul Getty Trust and World Monuments Fund This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ''' from django.conf.urls import include, url from django.contrib.staticfiles.urls import staticfiles_urlpatterns from arches.app.views import concept, main, map, search, graph, tileserver from arches.app.views.admin import ReIndexResources from arches.app.views.graph import GraphManagerView, GraphSettingsView, GraphDataView, DatatypeTemplateView, CardManagerView, CardView, FormManagerView, FormView, ReportManagerView, ReportEditorView, FunctionManagerView, PermissionManagerView, PermissionDataView from arches.app.views.resource import ResourceEditorView, ResourceListView, ResourceData, ResourceCards, ResourceReportView, RelatedResourcesView, ResourceDescriptors, ResourceEditLogView from arches.app.views.concept import RDMView from arches.app.views.user import UserManagerView from arches.app.views.tile import TileData from arches.app.views.map import MapLayerManagerView from arches.app.views.mobile_survey import MobileSurveyManagerView, MobileSurveyResources from arches.app.views.auth import LoginView, SignupView, ConfirmSignupView, ChangePasswordView, GetTokenView from arches.app.models.system_settings import settings # Uncomment the next two lines to enable the admin: from django.contrib import admin admin.autodiscover()