Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #30387 - Remove
view_bookmarks
permission
Users should always be able to see public bookmarks and their own bookmarks, a permission is not needed for this case.
- Loading branch information
1 parent
68ca9ee
commit 81512f7
Showing
7 changed files
with
25 additions
and
17 deletions.
There are no files selected for viewing
4 changes: 2 additions & 2 deletions
4
app/controllers/concerns/foreman/controller/bookmark_common.rb
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,9 +1,9 @@ | ||
module Foreman::Controller::BookmarkCommon | ||
def resource_base | ||
super.my_bookmarks | ||
Bookmark.my_bookmarks | ||
end | ||
|
||
def resource_scope(*args) | ||
super.my_bookmarks | ||
Bookmark.my_bookmarks | ||
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
11 changes: 11 additions & 0 deletions
11
db/migrate/20210502113529_drop_view_bookmarks_permission.rb
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class DropViewBookmarksPermission < ActiveRecord::Migration[6.0] | ||
def up | ||
Permission.where(name: 'view_bookmarks').destroy_all | ||
# clean up any empty filters left behind | ||
Filter.where.not(id: Filtering.distinct.select(:filter_id)).destroy_all | ||
end | ||
|
||
def down | ||
# Will be recreated automatically by seeds | ||
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
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