Comments (10)
This will happen if the value for the "read" action when setting up the permissions plugin is an empty array, ie. publicly readable.
In this case the checkbox cannot be used because there are no permissions to apply to it if the box were to be unchecked. So we freeze it. The checkbox can be hidden in this case by setting the (currently undocumented) showViewPermissionsCheckbox
option to false
.
annotator.addPlugin('Permissions', {
user: 'Alice',
permissions: {
'read': [], // Annotations are always public.
'update': ['Alice'],
'delete': ['Alice'],
'admin': ['Alice']
},
showViewPermissionsCheckbox: false // Hide view checkbox.
});
I will document this and showEditPermissionsCheckbox
right now
from annotator.
Documented under the options heading. http://github.com/okfn/annotator/wiki/Permissions-Plugin
from annotator.
Not sure this is really the right way it should work. We want to allow people to restrict access if they want. Why couldn't unchecking simply result in current user id being put in the read list?
Generally this suggests we should rework the authorization system to explicitly denote 'everyone'.
from annotator.
Take the current example:
{
'read': [], // Annotations are always public.
'update': ['Alice'],
'delete': ['Alice'],
'admin': ['Alice']
}
It should be possible to uncheck this checkbox if an admin (Alice) is viewing the annotation. Otherwise the checkbox should be permanently disabled (or not even displayed to the user?).
Once unchecked the current user's id should be inserted into the 'read' array. (Question: should all annotation admins be inserted into the 'read' array? Probably).
We have decided to postpone this ticket for now as there remains a larger discussion to be resolved regarding the implementation of permissions.
from annotator.
Okay, let's reopen this conversation. When I originally designed the permissions plugin, the meaning of []
and null
or undefined
was different. Specifically, {delete: null}
or {}
meant "anyone can delete", while {delete: []}
meant "no-one can delete". Do we currently have a way of specifying the latter?
I agree with Aron that if the viewing user doesn't have 'admin' authorisation for the current annotation (which for AnnotateIt they do have by default for annotations they created) then we shouldn't display any Permissions UI.
from annotator.
So, note to self: this needs fixing, as users using AnnotateIt should be able to prevent their annotations showing up in public-readable searches, if they so desire.
from annotator.
users using AnnotateIt should be able to prevent their annotations showing up in public-readable searches
Is this not possible now by adding their id into the read
array?
Specifically, {delete: null} or {} meant "anyone can delete", while {delete: []} meant "no-one can delete". Do we currently have a way of specifying the latter
No, I don't think their is anyway that you can specify the latter without putting the creators (or someones) id into the array. Although that said, this might be possible by putting null
into the array eg. {delete: [null]}
.
from annotator.
Is this not possible now by adding their id into the read array?
Yes, it is, but the UI doesn't actually allow you to uncheck the box that would do that!
As for the second issue, I think it's probably less of a concern now. It doesn't make that much sense to allow people to prevent themselves from deleting an annotation.
from annotator.
Closed by 7cae58b
from annotator.
Yes, it is, but the UI doesn't actually allow you to uncheck the box that would do that!
I believe it allowed you to uncheck it if you put the id in the @options.permissions when the plugin was loaded. That's why it was storing the id in the data attribute. Your update is simpler for now anyway.
from annotator.
Related Issues (20)
- Dynamic content. How to update ranges?
- Does anyone else have a problem with deleting/updating an annotation? HOT 4
- Is it possible to remove loaded annotations in 2. HOT 1
- Which search key is used? HOT 1
- Documentation for stable/1.2x missing ? HOT 3
- jQuery data is visible only in some stack frames HOT 1
- adjust the z-index
- How to save annotations with store plugin? HOT 20
- Does not display annotations in a pdf document. HOT 2
- viewer: new annotations for the same word
- Store plugin: how to send variable values in annotationData HOT 6
- Unable to console.log store pluggin output getting following error ---- Could not load Tags plugin. Have you included the appropriate <script> tag?
- Uncaught TypeError: Cannot read property 'nodeType' of undefined
- Uncaught TypeError: Cannot read property 'hide' of null
- active forks HOT 2
- Sorry, I don't know how to display the saved data to the page
- Page loading two times when i added annotations to body tag
- i cannot see highlight tags on screen when i loaded annotators (json format)
- this doesn't work. HOT 1
- why jquery is not defined >?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from annotator.