Skip to content
Adam Pahlevi Baihaqi edited this page Mar 1, 2016 · 19 revisions

Welcome

Please enjoy using the world's easiest way to do role-based authorisation, in any of your Ruby files, apps, web apps, mobile apps, test specs, and so and so on!

Expect this wiki to contain resources to get you started.

Cheers, Bali maintainers

Assumptions

Throughout this wiki, you will see a lot of My::Transaction which is a class with the following definition:

class My::Transaction
  attr_accessor :is_settled
  attr_accessor :payment_channel

  alias :is_settled? :is_settled
end

And My::SecuredTransaction, a subclass of My::Transaction with the following definition:

class My::SecuredTransaction < My::Transaction
end

And My::Employee with the following definition:

class My::Employee
  # working experience in the company
  attr_accessor :exp_years

  # role/roles of this employee
  attr_accessor :roles
end

Table of Contents

  1. How to define rules?
  2. How to do access authorisation?
  3. How if the user has more than one role?
  4. How to pretty-print all defined rules
  5. How to integrate with Rails

Maintainers

  1. Adam Pahlevi Baihaqi