Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Roles Group API

kristianmandrup edited this page · 1 revision

add_group

Add a single user role group

User.add_role_group :guests => [:user, :guest]
User.add_role_group :editors => :editor

add_groups

Add multiple user role groups in one line

User.add_role_groups :guests => [:user, :guest], :editors => :editor

is_in_group?

Is any of the roles of the user in the role group?

@admin_user.is_in_group? :guests
@normal_user.is_in_group? :users

is_in_groups?

Is any of the roles of the user in all the role groups?

@admin_user.is_in_groups? :guests
@normal_user.is_in_groups? :guests, :users

is_in_any_group

Is any of the roles of the user in all the role groups?

@admin_user.is_in_any_group? :guests
@normal_user.is_in_any_group? :guests, :editors
Something went wrong with that request. Please try again.