Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

update specification after implementation

ulfertsbc717d58130f
diff --git a/docs/api/apiv3/endpoints/actions.apib b/docs/api/apiv3/endpoints/actions.apib
index 828ccf5db15..c34e4189ad1 100644
--- a/docs/api/apiv3/endpoints/actions.apib
+++ b/docs/api/apiv3/endpoints/actions.apib
@@ -21,9 +21,9 @@ because some other requirement is not met.
E.g. A user might have the capability to update work packages, but if a particular work package is
in a readonly state, that work package cannot be updated.
-## Open
+*Only a small set of actions that actually already exist in the system are currently exposed via
+the api. They will be added over time.*
-* List the roles granting the permission within the context in a capabilities?
## Action
@@ -36,12 +36,12 @@ which turns it into a capability, it remains in the state of "could be".
| self | The action | Action | not null | READ |
### Local Properties
-| Property | Description | Type | Constraints | Supported operations |
-| :---------: | --------------------------------------------- | ----------- | ----------- | -------------------- |
-| id | Identifier for the action | String | Not null | READ |
-| name | A human readable name for the action | String | Not null | READ |
-| description | Describes what can be done by principals having that action | String | Not null | READ |
-| modules | Clusters the actions into groups into which they belong logically | []String | Not null | READ |
+| Property | Description | Type | Constraints | Supported operations |
+| :---------: | --------------------------------------------- | ----------- | ----------- | -------------------- |
+| id | Identifier for the action | String | Not null | READ |
+| name | A human readable name for the action *Not yet implemented* | String | Not null | READ |
+| description | Describes what can be done by principals having that action *Not yet implemented* | String | Not null | READ |
+| modules | Clusters the actions into groups into which they belong logically *Not yet implemented* | []String | Not null | READ |
## Capabilities
@@ -90,6 +90,8 @@ The configuration is adaptable by admins within the administration of the OpenPr
## View action [GET]
+Returns an individual action.
+
+ Parameters
+ id (required, string, `work_packages/create`) ... action id which is the name of the action
@@ -167,14 +169,14 @@ In addition to the provided filters, the server will reduce the result set to on
has sufficient permissions.
+ Parameters
- + filters (optional, string, `[{ "modules": { "operator": "~", "values": ["versions"] }" }]`) ... JSON specifying filter conditions.
+ + filters (optional, string, `[{ "id": { "operator": "=", "values": ["memberships/create"] }" }]`) ... JSON specifying filter conditions.
Accepts the same format as returned by the [queries](#queries) endpoint.
Currently supported filters are:
- + modules: The actions are clustered by modules they apply to. Using this filter, one can reduce the filter set by that property.
+ + id: Returns only the action having the id or all actions except those having the id(s).
+ sortBy = ["id", "asc"] (optional, string, `[["id", "asc"]]`) ... JSON specifying sort criteria.
Accepts the same format as returned by the [queries](#queries) endpoint. Currently supported sorts are:
- + id: Sort by primary key
+ + *No sort supported yet*
+ Response 200 (application/hal+json)
@@ -203,7 +205,7 @@ has sufficient permissions.
"title": "Some user"
}
},
- "_type": "Action",
+ "_type": "Capability",
"id": "work_packages/create/p123-567"
}
@@ -236,7 +238,17 @@ has sufficient permissions.
{
"_links": {
- "self": { "href": "/api/v3/capabilities" }
+ "self": {
+ "href": "/api/v3/capabilities"
+ },
+ "changeSize": {
+ "href": "/api/v3/capabilities?pageSize={size}",
+ "templated": true
+ },
+ "jumpTo": {
+ "href": "/api/v3/capabilities?offset={offset}",
+ "templated": true
+ }
},
"total": 4,
"count": 4,
@@ -270,8 +282,7 @@ has sufficient permissions.
"href": "/api/v3/capabilities/work_packages/assignee/p123-567"
},
"action": {
- "href": "/api/v3/actions/work_packages/assignee",
- "title": "Become work package assignee"
+ "href": "/api/v3/actions/work_packages/assignee"
},
"context": {
"href": "/api/v3/projects/123",
@@ -292,8 +303,7 @@ has sufficient permissions.
"title": "Create members"
},
"action": {
- "href": "/api/v3/actions/memberships/create",
- "title": "Create a membership for a user in a project"
+ "href": "/api/v3/actions/memberships/create"
},
"context": {
"href": "/api/v3/projects/345",
@@ -335,14 +345,16 @@ has sufficient permissions.
Returns a collection of actions assigned to a principal in a context. The client can choose to filter the actions similar to how work packages are filtered. In addition to the provided filters, the server will reduce the result set to only contain actions, for which the requesting client has sufficient permissions
+ Parameters
- + filters (optional, string, `[{ "action_module": { "operator": "~", "values": ["work_packages"] }" }]`) ... JSON specifying filter conditions.
+ + filters (optional, string, `[{ "principal": { "operator": "=", "values": ["1"] }" }]`) ... JSON specifying filter conditions.
Accepts the same format as returned by the [queries](#queries) endpoint.
- No filters are available as of now.
+ + action: Get all capabilities of a certain action
+ + principal: Get all capabilities of a principal
+ + context: Get all capabilities within a context. Note that for a project context the client needs to provide `p{id}`, e.g. `p5` and for the global context a `g`
+ sortBy = ["id", "asc"] (optional, string, `[["id", "asc"]]`) ... JSON specifying sort criteria.
Accepts the same format as returned by the [queries](#queries) endpoint. Currently supported sorts are:
- + id: Sort by primary key
+ + id: Sort by the capabilities id
+ Response 200 (application/hal+json)
@@ -383,34 +395,4 @@ Returns the global capability context. This context is necessary to consistently
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:NotFound",
"message": "The requested resource could not be found."
- }
-
-
-
-
-
-
-
-
-
-## List principals having permission
-
-/api/v3/principals?filters=[{ "action": { "operator": "=", "values": ["addWorkPackage"]}, { "member": { "operator": "=", values: ["123"] } }]
-
-This requires knowledge, that the actions derive from memberships. Ideally, we would have the ability to communicate the context as well as the action in one filter.
-We could combine it in the value like this: "addWorkPackage-p451" but that would require the client to construct the value.
-
-Alternatively, we would embed. The list action filter allows filtering by action and context. Once including (signaling) works, this can then be used.
-
-## List projects in which current user has permission
-
-/api/v3/projects?filters=[{ "assignedAction": { "operator": "=", "values": ["work_packages/create"]}]
-
-Open: Do we need to get the projects for other users => member filter
-
-## Roles that allow an action
-
-/api/v3/roles?filters=[{ "action": { "operator": "=", "values": ["work_packages/create"]}]
-
-Using this, the client can decide which role is necessary for a user to receive so that an action can be performed. e.g. Which role does the user need to receive so that
-he can become assignee.
+ }
\ No newline at end of file