diff --git a/.gitignore b/.gitignore index 06cbdf8..721745e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ /.bundle/ /.yardoc -/Gemfile.lock +Gemfile.lock /_yardoc/ /coverage/ /doc/ diff --git a/README.md b/README.md index 01e2031..36c66ac 100644 --- a/README.md +++ b/README.md @@ -13,10 +13,6 @@ Sinja aims to be lightweight (to the extent that Sinatra is), ORM-agnostic (to the extent that JSONAPI::Serializers is), and opinionated (to the extent that the JSON:API specification is). -**CAVEAT EMPTOR: This gem is still very new and under active development. The -API is mostly stable, but there still may be significant breaking changes. It -has not yet been thoroughly tested or vetted in a production environment.** - diff --git a/demo-app/Gemfile.lock b/demo-app/Gemfile.lock deleted file mode 100644 index 757656f..0000000 --- a/demo-app/Gemfile.lock +++ /dev/null @@ -1,67 +0,0 @@ -PATH - remote: .. - specs: - sinja (0.2.0.beta2) - activesupport (>= 4.2.7.1, < 6) - json (>= 1.8.3, < 3) - jsonapi-serializers (~> 0.16) - mustermann (>= 1.0.0.beta2, < 2) - sinatra (>= 1.4.7, < 3) - sinatra-contrib (>= 1.4.7, < 3) - -GEM - remote: https://rubygems.org/ - specs: - activesupport (5.0.0.1) - concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) - minitest (~> 5.1) - tzinfo (~> 1.1) - backports (3.6.8) - concurrent-ruby (1.0.2) - i18n (0.7.0) - json (2.0.2) - jsonapi-serializers (0.16.1) - activesupport - minitest (5.10.0) - minitest-hooks (1.4.0) - multi_json (1.12.1) - mustermann (1.0.0.beta2) - rack (1.6.5) - rack-protection (1.5.3) - rack - rack-test (0.6.3) - rack (>= 1.0) - rake (11.3.0) - sequel (4.40.0) - sinatra (1.4.7) - rack (~> 1.5) - rack-protection (~> 1.4) - tilt (>= 1.3, < 3) - sinatra-contrib (1.4.7) - backports (>= 2.0) - multi_json - rack-protection - rack-test - sinatra (~> 1.4.0) - tilt (>= 1.3, < 3) - sqlite3 (1.3.12) - thread_safe (0.3.5) - tilt (2.0.5) - tzinfo (1.2.2) - thread_safe (~> 0.1) - -PLATFORMS - ruby - -DEPENDENCIES - bundler (~> 1.11) - minitest (~> 5.9) - minitest-hooks (~> 1.4) - rake (~> 11.3) - sequel (~> 4.38) - sinja! - sqlite3 (~> 1.3) - -BUNDLED WITH - 1.13.6 diff --git a/demo-app/classes/comment.rb b/demo-app/classes/comment.rb index eb65947..d401c05 100644 --- a/demo-app/classes/comment.rb +++ b/demo-app/classes/comment.rb @@ -81,6 +81,9 @@ def role end graft(roles: :superuser, sideload_on: :create) do |rio| + halt 403, 'You may only assign yourself as comment author!' \ + unless role?(:superuser) || rio[:id].to_i == current_user.id + resource.author = Author.with_pk!(rio[:id].to_i) resource.save_changes(validate: !sideloaded?) end diff --git a/lib/sinja/version.rb b/lib/sinja/version.rb index fbaaed5..32183d2 100644 --- a/lib/sinja/version.rb +++ b/lib/sinja/version.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: false +# frozen_string_literal: true module Sinja - VERSION = '0.2.0.beta2'.freeze + VERSION = '1.0.0.pre1' end