百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
S

six

> 后端框架
开源

超轻权限库

321 stars0 点赞3 次浏览
访问官网GitHub

工具介绍

超轻权限库

Six - is a simple authorization gem for Ruby!

based on clear ruby it can be used for Rails applications or any other framework

Installation

ruby
  gem install six

QuickStart

4 steps:

  1. create abilities object

    ruby
      abilities = Six.new
  2. create object/class with allowed method - here you'll put conditions to define abilities

    ruby
    class BookRules
      def self.allowed(author, book)
        [:read_book, :edit_book]
      end
    end
  3. Add object with your rules to abilities

    ruby
    abilities  BookRules) # same as Six.new & add(:book_rules, BookRules)

with more

abilities = Six.new(:book => BookRules, :auth => AuthRules, :managment => ManagerRules)


### Adding rules

```ruby

abilities = Six.new

# 1. simple (recommended)
# but you cant use  abilities.use(:book_rules) to 
# search over book namespace only
abilities  more perfomance

Namespaces

…

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubyauthorizationrailsruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类后端框架
定价开源

> 相关工具

N
Node.js
基于 V8 的 JavaScript 运行时
D
Django
Python 高级 Web 框架
S
Spring Boot
Java 生态主流微服务框架