-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #506 from openannotation/registry-rejig
Registry rejig
- Loading branch information
Showing
52 changed files
with
1,422 additions
and
1,567 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
.. default-domain: js | ||
annotator package | ||
================= | ||
|
||
.. class:: annotator.App([options]) | ||
|
||
App is the coordination point for all annotation functionality. App instances | ||
manage the configuration of a particular annotation application, and are the | ||
starting point for most deployments of Annotator. | ||
|
||
|
||
.. function:: annotator.App.prototype.include(module[, options]) | ||
|
||
Include a plugin module. If an `options` object is supplied, it will be | ||
passed to the plugin module at initialisation. | ||
|
||
If the returned plugin has a `configure` function, this will be called with | ||
the application registry as its first parameter. | ||
|
||
:param Object module: | ||
:param Object options: | ||
:returns: The Annotator instance, to allow chained method calls. | ||
|
||
|
||
.. function:: annotator.App.prototype.start() | ||
|
||
Tell the app that configuration is complete. This binds the various | ||
components passed to the registry to their canonical names so they can be | ||
used by the rest of the application. | ||
|
||
Runs the 'start' plugin hook. | ||
|
||
:returns Promise: Resolved when all plugin 'start' hooks have completed. | ||
|
||
|
||
.. function:: annotator.App.prototype.runHook(name[, args]) | ||
|
||
Run the named hook with the provided arguments | ||
|
||
:returns Promise: Resolved when all over the hook handlers are complete. | ||
|
||
|
||
.. function:: annotator.App.prototype.destroy() | ||
|
||
Destroy the App. Unbinds all event handlers and runs the 'destroy' plugin | ||
hook. | ||
|
||
:returns Promise: Resolved when destroyed. | ||
|
||
|
||
.. function:: annotator.App.extend(object) | ||
|
||
Create a new object which inherits from the App class. | ||
|
||
|
||
.. function:: annotator.supported([details=false, scope=window]) | ||
|
||
Examines `scope` (by default the global window object) to determine if | ||
Annotator can be used in this environment. | ||
|
||
:returns Boolean: | ||
Whether Annotator can be used in `scope`, if `details` is | ||
false. | ||
:returns Object: | ||
If `details` is true. Properties: | ||
|
||
- `supported`: Boolean, whether Annotator can be used in `scope`. | ||
- `details`: Array of String reasons why Annotator cannot be used. | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.. default-domain: js | ||
annotator.authz package | ||
======================= | ||
|
||
.. data:: annotator.authz.defaultAuthorizationPolicy | ||
|
||
Default authorization policy. | ||
|
||
|
||
.. function:: annotator.authz.defaultAuthorizationPolicy.permits(action, | ||
annotation, | ||
identity) | ||
|
||
Determines whether the user identified by `identity` is permitted to | ||
perform the specified action on the given annotation. | ||
|
||
If the annotation has a "permissions" object property, then actions will | ||
be permitted if either of the following are true: | ||
|
||
a) annotation.permissions[action] is undefined or null, | ||
b) annotation.permissions[action] is an Array containing `identity`. | ||
|
||
If the annotation has a "user" property, then actions will be permitted | ||
only if `identity` matches this "user" property. | ||
|
||
If the annotation has neither a "permissions" property nor a "user" | ||
property, then all actions will be permitted. | ||
|
||
:param String action: The action the user wishes to perform. | ||
:param annotation: | ||
:param identity: The identity of the user. | ||
|
||
:returns Boolean: Whether the action is permitted. | ||
|
||
|
||
.. function:: annotator.authz.defaultAuthorizationPolicy.authorizedUserId(identity) | ||
|
||
Returns the authorized userid for the user identified by `identity`. | ||
|
||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.