Skip to content

Commit

Permalink
Docs for generator, re #9
Browse files Browse the repository at this point in the history
  • Loading branch information
smathy committed Jan 12, 2015
1 parent 0293148 commit 99b9bd6
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions README.md
Expand Up @@ -99,6 +99,25 @@ user.has_no_role! :support, School
You can see more about all this stuff in the wiki under [Role
Subsystem](//github.com/be9/acl9/wiki/Role-Subsystem)

## Database Setup

As mentioned in [Role Subsystem](//github.com/be9/acl9/wiki/Role-Subsystem) you
don't have to use these, if your role system is very simple all you need is a
`has_role?` method in your subject model that returns a boolean and the Access
Control part of Acl9 will work from that.

However, most commonly, the roles and role assignments are stored in two new
tables that you create specifically for Acl9. There's a rails generator for
creating the migrations, role model and updating the subject model and
optionally any number of object models.

You can view the USAGE for this generator by running the following in your app
directory:

```sh
bin/rails g acl9:setup -h
```

## Configuration

There are five configurable settings. These all have sensible defaults which can
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/acl9/setup/USAGE
Expand Up @@ -20,7 +20,7 @@ Examples:
And it will update (or create a skeleton):
Subject Model: app/models/user.rb

`rails g acl9:install account permission school classroom department`
`rails g acl9:setup account permission school classroom department`

This will create:
Migration: db/migrate/XXX_create_permission_tables.rb
Expand Down

0 comments on commit 99b9bd6

Please sign in to comment.