Releases: the-teacher/the_role
Based on role for New role form
This release provide select field for "new role" form
Now it's easy to create new roles based on previous created roles
you should use following gem set to get new functionality
the_role 2.5.3
the_role_bootstrap3_ui 1.1
Some refactoring for to_slug_param
This release has minor changes for internal methods which provide processing of incoming test strings
was
def has_section? section_name
to_hash.key? section_name.to_s.to_slug_param(delimiter: '_')
end
became
def has_section? section_name
to_hash.key? section_name.to_slug_param(sep: '_')
end
TheRole param helper replaced with gem TheStringToSlug
I drop old ParamHelper and replace it with my helper-gem for building of slugs
GUI moved to external gem
The Role became popular. TheRole is unique because it has flexible Admin GUI.
Now GUI based on Bootstrap3, but some users wants to use other front-end frameworks for UI, for example Foundation
Today we separate base of TheRole and Bootstrap3 UI for it. Now end-point user can create own versions of UI for TheRole!
Last 3 months was hard for me, because I changed a job. But now I have a little piece of time to improve few my gems.
And I want to say - Hello community! I'm here again )
Installation
Now you should use following strings to use TheRole
gem 'the_role'
gem 'the_role_bootstrap3_ui'
Check it after bundlig
Installing the_role (2.4)
Installing the_role_bootstrap3_ui (1.0)
Read docs and instructions here
https://github.com/the-teacher/the_role
https://github.com/the-teacher/the_role_bootstrap3_ui
Refactoring. Please learn README again
Refactoring. Please learn README again
Localizations (En [fix], Pl [new]). Admin UI fields editing
Few pull requests from users added.
-
Thanks to @egb3 for fixing of localization files and new PL localization
-
Thanks to @daanforever for addition of fields editing. It's very helpfull
- @jordansexton, sorry, your pull request not integrated in this release. But I think it will be soon.
Thank to everybody for help!
Massive role checking via User#any_role? & Role#any?
Massive role checking via User#any_role? & Role#any?
TheRole 2.1.0 provide following methods User#any_role? and Role#any? for massive checking of user's roles.
Now you can write following code:
- if @user.any_role?(posts: :manage, pages: :manage)
%h4 Publications:
%ul
- if @user.has_role?(:posts, :manage)
%li= link_to 'My Posts', manage_user_posts_url(@user)
- if @user.has_role?(:pages, :manage)
%li= link_to 'My Pages', manage_user_pages_url(@user)
instead:
- if @user.has_role?(:posts, :manage) || @user.has_role?(:pages, :manage)
%h4 Publications:
%ul
- if @user.has_role?(:posts, :manage)
%li= link_to 'My Posts', manage_user_posts_url(@user)
- if @user.has_role?(:pages, :manage)
%li= link_to 'My Pages', manage_user_pages_url(@user)
I hope it's will be usefull not only for me.
Have a nice day!