Project

General

Profile

Actions

Bug #15520

closed

Delete cloned role via API

Added by a d^2 almost 8 years ago. Updated almost 8 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

I cloned the "Viewer" role then hoping to get all the filters then customize the filters I did not need for this role. The new roles was named "Ops Viewer".

1. The filters drop down next to the new role shows - Add filter and Clone.
2. The new role is not linked to any filters like the built in roles. I was expecting to see all the filter cloned as well.

The bug I am submitting is regarding the ability to delete this new cloned role.

1. Can't delete it via the UI.
2. Can delete it via the API.

[API]

Via Browser: https://foreman.host.com/api/roles/12
Result:

{"builtin":null,"name":"Ops Viewer","id":12,"filters":[{"id":122},{"id":123},{"id":124},{"id":125},{"id":126},{"id":127},{"id":128},{"id":129},{"id":130},{"id":131},{"id":132},{"id":133},{"id":134},{"id":135},{"id":136},{"id":137},{"id":138},{"id":139},{"id":140},{"id":141},{"id":142},{"id":143},{"id":144},{"id":145},{"id":146},{"id":147},{"id":148},{"id":149},{"id":150},{"id":151},{"id":152},{"id":153},{"id":154},{"id":155},{"id":156},{"id":157}]}

Curl Post trying to delete it:

A. curl --user <me> -k -i -X DELETE -d '{"id": 12, "name": "Ops Viewer", "builtin": "null"}' https://foreman.host.com/api/roles/12
B. curl --user <me> -k -i -X DELETE -d '{"id": 12, "name": "Ops Viewer", "builtin": 0}' https://foreman.host.com/api/roles/12

Both attempts output the following error:

HTTP/1.1 422 Unprocessable Entity
Date: Fri, 24 Jun 2016 17:38:17 GMT
Server: Apache/2.4.6 (Scientific Linux)
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Foreman_version: 1.11.3
Foreman_api_version: 2
Apipie-Checksum: f0a950d90c83923ee3fda330c16aadee
Cache-Control: no-cache
X-Request-Id: 31d69b13-98a6-46cf-a009-06ea65d0dbad
X-Runtime: 0.084663
X-Powered-By: Phusion Passenger 4.0.53
Set-Cookie: request_method=DELETE; path=/
Set-Cookie: _session_id=ecd98e3ace226047fc95e833adee89be; path=/; secure; HttpOnly
Status: 422 Unprocessable Entity
Connection: close
Transfer-Encoding: chunked
Content-Type: application/json; charset=utf-8

{
"error": {"id":12,"errors":{"base":["Can't delete built-in role"]},"full_messages":["Can't delete built-in role"]}
}


Related issues 1 (0 open1 closed)

Is duplicate of Foreman - Bug #15108: Cloned role has no builtin valueClosedMarek Hulán05/20/2016Actions
Actions #1

Updated by Dominic Cleal almost 8 years ago

  • Is duplicate of Bug #15108: Cloned role has no builtin value added
Actions #2

Updated by Dominic Cleal almost 8 years ago

  • Status changed from New to Duplicate

Thanks for the report - this issue has been fixed in 1.12, which is now available in release candidates.

Actions

Also available in: Atom PDF