-
Notifications
You must be signed in to change notification settings - Fork 143
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 #749 from gtanzillo/enable-add-edit-policy-profiles
Enable add and edit resource for /api/policy_profiles endpoint (cherry picked from commit 32ea08e) Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1806702
- Loading branch information
Showing
3 changed files
with
91 additions
and
7 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
module Api | ||
class PolicyProfilesController < BaseController | ||
include Subcollections::Policies | ||
|
||
def edit_resource(type, id, _data = {}) | ||
raise ForbiddenError if collection_class(:policy_profiles).find(id).read_only? | ||
|
||
super | ||
end | ||
|
||
def delete_resource(type, id, _data = {}) | ||
raise ForbiddenError if collection_class(:policy_profiles).find(id).read_only? | ||
|
||
super | ||
end | ||
end | ||
end |
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