Giter Club home page Giter Club logo

Comments (10)

aron avatar aron commented on July 21, 2024

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.

aron avatar aron commented on July 21, 2024

Documented under the options heading. http://github.com/okfn/annotator/wiki/Permissions-Plugin

from annotator.

rufuspollock avatar rufuspollock commented on July 21, 2024

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.

aron avatar aron commented on July 21, 2024

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.

nickstenning avatar nickstenning commented on July 21, 2024

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.

nickstenning avatar nickstenning commented on July 21, 2024

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.

aron avatar aron commented on July 21, 2024

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.

nickstenning avatar nickstenning commented on July 21, 2024

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.

nickstenning avatar nickstenning commented on July 21, 2024

Closed by 7cae58b

from annotator.

aron avatar aron commented on July 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.