Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Manage your users' operations (permissions to execute some actions) in your Ruby on Rails application.
Prior to installing, please make sure these gems can be installed on your system:
If you wish to run this gem locally, the following gems are also to consider:
Add this line to your application's Gemfile:
gem 'operations'
And then execute:
$ bundle
Or install it yourself as:
$ gem install operations
Here are the most relevant API entries from this Gem:
### From Operations module
Operations.operations_list # All valid Operations::Operation from Rails config
Operations.from_string(name) # Gets the Operations::Operation by string
Operations.allows?(user, name) # Checks if the user can execute the operation string
Operations.user_roles # All users roles defined in the Rails config
### From Operations::Operation class
operation = Operations::Operation.new do |operation|
# Your operation name
operation.name = 'my_operation'
# Allows :admin, :technician, :regular and :guest.
# These can be set in your config/application.rb with the
# variable config.user_roles. Example:
#
# module MyApp
# class Application < Rails::Application
# config.user_roles += {name: 'my_other_scope'}
# end
# end
operation.scope = :admin
end
# Or
operation = Operations::Operation.new{name: :my_operation, scope: :admin}
# Instance variable
allowed_users = operation.users # Returns a list of users based on the scope
is_valid = operation.is_valid? # For validation purposes
### Core extensions
# Convert a string to a list of Operations::Operations
"bf9[..]a248".to_operation # From a UUID (example truncated)
"{\"name\":\"my_operation\",\"scope\":\"admin\"}".to_operation # From a valid JSON string
Do you wish to contribute? It's simple! All you need to do is:
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that aki-operations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.