Skip to content
Snippets Groups Projects

Create new policies for read, destroy, and create tokens

Merged Serena Fang requested to merge sfang-token-read-write-permissions into master
All threads resolved!
Compare and
21 files
+ 206
52
Compare changes
  • Side-by-side
  • Inline
Files
21
@@ -5,7 +5,7 @@ module Settings
class AccessTokensController < Projects::ApplicationController
include ProjectsHelper
before_action :check_feature_availability
before_action :check_can_read, only: [:index]
feature_category :authentication_and_authorization
@@ -42,8 +42,8 @@ def revoke
private
def check_feature_availability
render_404 unless project_access_token_available?(@project)
def check_can_read
render_404 unless can?(current_user, :read_resource_access_tokens, @project)
end
def create_params
Loading