Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      OpenProject ID Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • Wiki
    Wiki
  • News

Content

Updated by Kabiru Mwenja 1 day ago

Follows ###64166

**As** an API client
**I want to** be able to know if a user has the capability to add internal comments
**so that** I can fully support internal comments in my application

**Acceptance criteria**

* It is possible to check via the [**Capabilities API**](https://www.openproject.org/docs/api/endpoints/actions-capabilities/), whether a user has the capability to add internal comments


**Technical notes**

GET /api/v3/capabilities

```json
// ?filters=

[
{
"principal": {
"operator": "=",
"values": [
"435" // The current user ID
]
}
},
{
"context": {
"operator": "=",
"values": [
"p861" // The Project ID
]
}
},
{
"action": {
"operator": "=",
"values": [
"work_packages/write_internal_comments"
]
}
}
]
```

_Similar Examples: In order to verify whether a user can create a reminder, we check that they are logged in and have the "work\_packages/read" capability E.g._ [_https://github.com/opf/openproject/commit/d10375c8cedcd1c0c58ac9448a5844a5b28d9075_](https://github.com/opf/openproject/commit/d10375c8cedcd1c0c58ac9448a5844a5b28d9075)

_Ref: https://www.openproject.org/docs/api/filters/_

**Permissions and visibility considerations**

* Permission: "[add\_internal\_comments](https://github.com/opf/openproject/blob/dab3a3e18134067758d62dc41791eb1ef1d57fac/config/initializers/permissions.rb#L325)"

* When the user does not have the "Write internal comments" and they attempt to mark a comment as internal, they should receive back an error AND the comment should never be created.

Back

Loading...