rabarber 5.2.3 → 5.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 58580c8850cc6cde86318dee64ffcf28bf9daea4ced15eddaf8ff6e0148670bc
4
- data.tar.gz: 6bd2d216d86d2c30d650cb190f7da17948b693bb9e0f7acd8df0cab2dfdae8ae
3
+ metadata.gz: 0b6af1a1a593e84b481d92883ca7adf385e2ee1fc9a3fb5615818169fc595444
4
+ data.tar.gz: 97738fdc3bb6e3463b8e331088982a4dcd40e62e4251977ee63cc8b742fcb96a
5
5
  SHA512:
6
- metadata.gz: '085794b488e723adbc08a8b0ec13005cd4352612b452df86ee85364ef3cdbe76288cc0f77d088844b6843134119048d26eb256c8999a0c86cdc0a9505aa5a4eb'
7
- data.tar.gz: 5c105b394e8984e8f3951c59e2a21b1c96508047a624fd86299ad6471d05d3e4bd6715363ecdf18d845fc6d788f569c7e4d5c6c41cec7cfb75eabaaf754f5d99
6
+ metadata.gz: 535dc707a59522461ad3b5bd26d0e394008454c738ff52e84fa6cd7ebfdd26bb441405326563b2ba4a2229008d0ddcf3b6b426dc9d21186896e53aadf99b5fa6
7
+ data.tar.gz: b32d8c3983deb895e7cefe2e3d273cbad0542477c1bad134a7681ac5ae1e390725f7e34b964de4c0f264fcb1b0d21546cb70b7d89ca29cb3c513e831d281c89c
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## v5.2.4
2
+
3
+ ### Misc:
4
+
5
+ - Added support for Rails 8.1
6
+
1
7
  ## v5.2.3
2
8
 
3
9
  ### Bugs:
data/README.md CHANGED
@@ -5,29 +5,35 @@
5
5
  [![Github Actions badge](https://github.com/enjaku4/rabarber/actions/workflows/ci.yml/badge.svg)](https://github.com/enjaku4/rabarber/actions/workflows/ci.yml)
6
6
  [![License](https://img.shields.io/github/license/enjaku4/rabarber.svg)](LICENSE)
7
7
 
8
- Rabarber is a role-based authorization library for Ruby on Rails that focuses on controller-level access control. Rather than answering domain questions like "can this user create a post?", Rabarber answers "can this user access the create post endpoint?", providing a clean separation between authorization and business logic.
8
+ Rabarber is a role-based authorization library for Ruby on Rails that focuses on controller-level access control. Rather than answering domain questions like "can this user create a post?", Rabarber answers "can this user access the create post endpoint?", providing a clean separation between authorization and business logic. It supports multi-tenancy through contextual roles, dynamic authorization with conditional logic, and includes view helpers for role-based content rendering.
9
9
 
10
- **Key Features:**
10
+ **Example of Usage:**
11
11
 
12
- - Role-based authorization
13
- - Controller-level access control
14
- - Multi-tenancy support through contextual roles
15
- - Dynamic authorization with conditional logic
16
- - View helpers for role-based content rendering
12
+ Consider a CRM system where users with different roles have distinct access levels. For instance, the role `accountant` can interact with invoices but cannot access marketing information, while the role `analyst` has access to marketing-related data. You can define such authorization rules easily with Rabarber.
17
13
 
18
- And this is how your controller might look with Rabarber:
14
+ And here's how your controller might look:
19
15
 
20
16
  ```rb
21
- class TicketsController < ApplicationController
22
- grant_access roles: :admin
17
+ class InvoicesController < ApplicationController
18
+ grant_access roles: :admin # Admin can access everything
23
19
 
24
- grant_access action: :index, roles: :manager
20
+ grant_access action: :index, roles: [:accountant, :analyst]
25
21
  def index
26
- # Accessible to admin and manager roles
22
+ # Accessible to both analysts and accountants
23
+ end
24
+
25
+ grant_access action: :show, roles: :accountant
26
+ def show
27
+ # Accessible to accountants
28
+ end
29
+
30
+ grant_access action: :analytics, roles: :analyst
31
+ def analytics
32
+ # Accessible to analysts
27
33
  end
28
34
 
29
35
  def destroy
30
- # Accessible to admin role only
36
+ # Accessible to admins only
31
37
  end
32
38
  end
33
39
  ```
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Rabarber
4
- VERSION = "5.2.3"
4
+ VERSION = "5.2.4"
5
5
  end
data/rabarber.gemspec CHANGED
@@ -27,5 +27,5 @@ Gem::Specification.new do |spec|
27
27
 
28
28
  spec.add_dependency "dry-configurable", "~> 1.1"
29
29
  spec.add_dependency "dry-types", "~> 1.7"
30
- spec.add_dependency "rails", ">= 7.1", "< 8.1"
30
+ spec.add_dependency "rails", ">= 7.1", "< 8.2"
31
31
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rabarber
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.3
4
+ version: 5.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - enjaku4
@@ -47,7 +47,7 @@ dependencies:
47
47
  version: '7.1'
48
48
  - - "<"
49
49
  - !ruby/object:Gem::Version
50
- version: '8.1'
50
+ version: '8.2'
51
51
  type: :runtime
52
52
  prerelease: false
53
53
  version_requirements: !ruby/object:Gem::Requirement
@@ -57,7 +57,7 @@ dependencies:
57
57
  version: '7.1'
58
58
  - - "<"
59
59
  - !ruby/object:Gem::Version
60
- version: '8.1'
60
+ version: '8.2'
61
61
  description: Rabarber provides role-based authorization for Ruby on Rails applications
62
62
  with support for multi-tenancy, dynamic rules, and clean controller-level access
63
63
  control that separates authorization from business logic