Module: Verifica
- Defined in:
- lib/verifica.rb,
lib/verifica/ace.rb,
lib/verifica/acl.rb,
lib/verifica/sid.rb,
lib/verifica/errors.rb,
lib/verifica/version.rb,
lib/verifica/authorizer.rb,
lib/verifica/acl_builder.rb,
lib/verifica/configuration.rb,
lib/verifica/authorization_result.rb,
lib/verifica/resource_configuration.rb
Overview
Verifica is Ruby’s most scalable authorization solution ready to handle sophisticated authorization rules.
-
Framework and database agnostic
-
Scalable. Start from 10, grow to 10M records in the database while having the same authorization architecture
-
Supports any actor in your application. Traditional
current_user
, external service, API client, you name it -
No global state. Only local, immutable objects
-
Plain old Ruby, zero dependencies, no magic
Verifica is designed around Access Control List. ACL clearly separates authorization rules definition (who can do what for any given resource) and execution (can current_user
delete this post?).
Defined Under Namespace
Modules: Sid Classes: Ace, Acl, AclBuilder, AuthorizationError, AuthorizationResult, Authorizer, Configuration, Error, ResourceConfiguration
Constant Summary collapse
- EMPTY_ACL =
Empty, frozen Access Control List. Semantically means that no actions are allowed
Verifica::Acl.new(EMPTY_ARRAY).freeze
- VERSION =
"1.0.2"
Class Method Summary collapse
-
.authorizer {|config| ... } ⇒ Authorizer
Creates a new Configuration and yields it to the given block.
- .subject_sids(subject, **context) ⇒ Object private
Class Method Details
.authorizer {|config| ... } ⇒ Authorizer
Creates a new Configuration and yields it to the given block
123 124 125 126 127 |
# File 'lib/verifica.rb', line 123 def self. config = Configuration.new yield config Authorizer.new(config.resources) end |
.subject_sids(subject, **context) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/verifica/authorizer.rb', line 5 def self.subject_sids(subject, **context) if subject.nil? raise Error, "Subject should not be nil" end sids = subject.subject_sids(**context) unless sids.is_a?(Array) || sids.is_a?(Set) raise Error, "Expected subject to respond to #subject_sids with Array or Set of SIDs but got '#{sids.class}'" end sids end |