mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 03:46:39 +08:00
Fix permission check;
This commit is contained in:
parent
a2c50cbe38
commit
ed8ef7aa8f
2 changed files with 7 additions and 2 deletions
|
@ -9,7 +9,8 @@ class RepositoriesController < ApplicationController
|
|||
before_action :check_view_all_permissions, only: :index
|
||||
before_action :check_view_permissions, only: %i(export_repository show)
|
||||
before_action :check_manage_permissions, only:
|
||||
%i(destroy destroy_modal rename_modal update share_modal)
|
||||
%i(destroy destroy_modal rename_modal update)
|
||||
before_action :check_share_permissions, only: :share_modal
|
||||
before_action :check_create_permissions, only:
|
||||
%i(create_modal create copy_modal copy)
|
||||
before_action :set_inline_name_editing, only: %i(show)
|
||||
|
@ -345,6 +346,10 @@ class RepositoriesController < ApplicationController
|
|||
render_403 unless can_manage_repository?(@repository)
|
||||
end
|
||||
|
||||
def check_share_permissions
|
||||
render_403 unless can_share_repository?(@repository)
|
||||
end
|
||||
|
||||
def repository_params
|
||||
params.require(:repository).permit(:name)
|
||||
end
|
||||
|
|
|
@ -70,7 +70,7 @@ class TeamRepositoriesController < ApplicationController
|
|||
end
|
||||
|
||||
def check_sharing_permissions
|
||||
render_403 unless can_manage_repository?(@repository)
|
||||
render_403 unless can_share_repository?(@repository)
|
||||
end
|
||||
|
||||
def teams_to_share
|
||||
|
|
Loading…
Add table
Reference in a new issue