File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
ckanext/datagov_inventory Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -118,9 +118,15 @@ def get_blueprint(self):
118118def redirect_homepage ():
119119 if current_user .is_authenticated or g .user :
120120 CKAN_SITE_URL = config .get ("ckan.site_url" )
121- return redirect (CKAN_SITE_URL + '/dataset' , code = 302 )
121+ return redirect (CKAN_SITE_URL + '/dataset/ ' , code = 302 )
122122 else :
123123 return base .render (u'error/anonymous.html' )
124124
125125
126126pusher .add_url_rule ('/' , view_func = redirect_homepage )
127+
128+ @pusher .before_app_request
129+ def check_dataset_access ():
130+ if toolkit .request .path in ('/dataset/' , '/dataset' ):
131+ if not current_user .is_authenticated and not g .user :
132+ return base .render (u'error/anonymous.html' ), 403
Original file line number Diff line number Diff line change @@ -26,6 +26,13 @@ describe('Public Access', () => {
2626 } ) . then ( ( response ) => {
2727 expect ( response . status ) . to . eq ( 403 ) ;
2828 } ) ;
29+
30+ cy . request ( {
31+ url : '/dataset/' ,
32+ failOnStatusCode : false ,
33+ } ) . then ( ( response ) => {
34+ expect ( response . status ) . to . eq ( 403 ) ;
35+ } ) ;
2936 } ) ;
3037
3138 it ( 'Cannot access the dataset pages' , ( ) => {
You can’t perform that action at this time.
0 commit comments