Class: Oauth2Provider::ScopesController
Instance Method Summary
collapse
#_oauth_provider_admin?
#_oauth_provider_authenticate, #_oauth_provider_json_body, #_oauth_provider_normalize_token, #api_request, #json?, #oauth_authorized, #session_auth
Instance Method Details
#create ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
|
# File 'app/controllers/oauth2_provider/scopes_controller.rb', line 18
def create
@scope = Oauth2Provider::Scope.new(params[:scope])
@scope.uri = @scope.base_uri(request)
@scope.values = @scope.normalize(params[:scope][:values])
if @scope.save
redirect_to(oauth2_provider_engine.oauth2_provider_scope_path(@scope), notice: "Resource was successfully created.")
else
render action: "new"
end
end
|
#destroy ⇒ Object
43
44
45
46
|
# File 'app/controllers/oauth2_provider/scopes_controller.rb', line 43
def destroy
@scope.destroy
redirect_to(scopes_url, notice: "Resource was successfully destroyed.")
end
|
#edit ⇒ Object
30
31
|
# File 'app/controllers/oauth2_provider/scopes_controller.rb', line 30
def edit
end
|
#index ⇒ Object
7
8
9
|
# File 'app/controllers/oauth2_provider/scopes_controller.rb', line 7
def index
@scopes = Oauth2Provider::Scope.all
end
|
#new ⇒ Object
14
15
16
|
# File 'app/controllers/oauth2_provider/scopes_controller.rb', line 14
def new
@scope = Oauth2Provider::Scope.new
end
|
#show ⇒ Object
11
12
|
# File 'app/controllers/oauth2_provider/scopes_controller.rb', line 11
def show
end
|
#update ⇒ Object
33
34
35
36
37
38
39
40
41
|
# File 'app/controllers/oauth2_provider/scopes_controller.rb', line 33
def update
@scope.values = @scope.normalize(params[:scope][:values])
if @scope.update_attributes(params[:scope])
render("show", notice: "Resource was successfully updated.")
else
render action: "edit"
end
end
|