Sha256: 6b2943afd2d0c63e09106e5926629c2c950424b471b6d54c4514b3404c12b0aa

Contents?: true

Size: 698 Bytes

Versions: 2

Compression:

Stored size: 698 Bytes

Contents

Roles
=====

Simple roles system.

Migrations
=====

  create_table :roles do |t|
    t.string :name
  end
  Role.create(:name => "administrator")


  create_table :privileges, :id => false do |t|
    t.integer :user_id
    t.integer :role_id
  end


Examples
=======

Available methods if administrator role has been created: 
    user.administrator? 
    user.is?(:administrator)
    user.is_not?(:administrator)

Add more roles in the migration: moderator, uploader etc.
    user.moderator?
    user.is?(:uploader)

Find all users with moderator role
    User.find_with_role(:moderator)
or
    Role[:moderator].users


Copyright (c) 2008 [name of plugin creator], released under the MIT license

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
objectreload-roles-0.1.1 README
objectreload-roles-0.1.0 README