Closed MandanaMoshref closed 4 years ago
Ok. I figured out what the problem was. I cloned and installed the master repository. In the action.py (https://github.com/EnviDat/ckanext-restricted/blob/065a336e26090b650748a88ebe2cbda5b23afb48/ckanext/restricted/action.py#L184)
this line is missing (in my opinion):
if not authorized: restricted_resource['url'] = 'Not Authorized'
When I added this line to my action.py it worked as I expected which means that it restricted the display of url link to not authorized users.
I am not sure whether my solution is right or it was the reason for my problem. However, it could be a work around solution. till it will be addressed by the developer.
Best Mani
Sorry, I have almost no time assigned to this project. Regarding the url, I think it worked as you suggested in the beginning and then I was asked to change it. Anyway, if the resource is a file uploaded to CKAN, even with the URL it cannot be downloaded if the user is not authorized. I am glad you found a solution that works for you. All the best!
Hello,
first of all many thanks for the great idea. The extension is very useful.
I have a very strange problem. I do not know whether it is me who missed some configurations or it is a bug.
I have a dataset with three resources. with the following restrictions:
I have another account with the role: "member " for Org. "A". I assume that I should be able to see the first two resources but not the third one. In the dataset page, it looks as it is expected![image](https://user-images.githubusercontent.com/21675686/61374783-8539cb80-a89d-11e9-8ce0-31987d2d85ea.png)
However, when I click on the first resource ("SOS Client") and go down towards resources, I can simply click on the third resource and get the information.![image](https://user-images.githubusercontent.com/21675686/61374965-fa0d0580-a89d-11e9-9cac-7422d934f31c.png)
The only thing which is not accessible is the preview of the resource. can someone explain what is the reason and how I can resolve it?
Best regards Mani