Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev.icinga.com #11926] Trying to delete an object protected by a permissions filter, ends up deleting all objects that match the filter instead #4275

Closed
icinga-migration opened this issue Jun 10, 2016 · 3 comments
Labels
area/api REST API blocker Blocks a release or needs immediate attention bug Something isn't working
Milestone

Comments

@icinga-migration
Copy link

This issue has been migrated from Redmine: https://dev.icinga.com/issues/11926

Created by madsfudb on 2016-06-10 11:46:27 +00:00

Assignee: gbeutner
Status: Resolved (closed on 2016-06-13 06:55:09 +00:00)
Target Version: 2.5.0
Last Update: 2017-01-13 08:56:46 +00:00 (in Redmine)

Icinga Version: 2.4.10
Backport?: Not yet backported
Include in Changelog: 1

Steps to reproduce:

# Create an API user and set the permissions filter for deleting, here shown with Service but could be any object type:

    {
      permission = "objects/delete/Service"
      filter = {{ obj.vars.custom_attr in ["foo"] }}
    },

# Create 3 services using the API (below examples shortened for clarity)

  curl PUT http://.../objects/services/service-bar1 -d '{ ... "vars.custom_attr": "bar" ...}
  curl PUT http://.../objects/services/service-foo1 -d '{ ... "vars.custom_attr": "foo" ...}
  curl PUT http://.../objects/services/service-foo2 -d '{ ... "vars.custom_attr": "foo" ...}

# Now try to delete service-bar1

  curl DELETE http://.../objects/services/service-bar1

# Retun value

{ "results":   [
      "type": "Service",
      "status": "Object was deleted.",
      "name": "service-foo1",
      "code": 200
    },
    {
      "type": "Service",
      "status": "Object was deleted.",
      "name": "service-foo2",
      "code": 200
    }
  ]
}

Changesets

2016-06-13 06:52:03 +00:00 by gbeutner 4072052

Fix default behavior when none of the specified objects pass the user's permission filter

fixes #11926

2016-06-13 08:14:10 +00:00 by gbeutner 9e29a3f

Fix default behavior when none of the specified objects pass the user's permission filter

fixes #11926

Subtasks:

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-06-13 06:52:22 +00:00

  • Status changed from New to Assigned
  • Assigned to set to gbeutner
  • Target Version set to 307

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-06-13 06:55:09 +00:00

  • Status changed from Assigned to Resolved
  • Done % changed from 0 to 100

Applied in changeset 4072052.

@icinga-migration
Copy link
Author

Updated by gbeutner on 2016-06-16 08:11:42 +00:00

  • Target Version changed from 307 to 2.5.0

@icinga-migration icinga-migration added blocker Blocks a release or needs immediate attention bug Something isn't working area/api REST API labels Jan 17, 2017
@icinga-migration icinga-migration added this to the 2.5.0 milestone Jan 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api REST API blocker Blocks a release or needs immediate attention bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant