Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6376489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:45:07+00:00 2026-05-25T01:45:07+00:00

I’m contemplating using RefineryCMS for a large web application which will include newsletters, blogs,

  • 0

I’m contemplating using RefineryCMS for a large web application which will include newsletters, blogs, forums, tutorials etc. Creating those things I know RefineryCMS would be great at.

My question is can RefineryCMS deal with different types of users with different types of access/permissions?

If I have a user which is a ‘member’ I would like to give them the ability to access the blog and forum, but if I have a ‘premium’ user they should have access to read newsletters, blogs, forums and tutorials. The ‘admin’ user should be able to manage and see everything in the site.

Is this type of fine grained control out of RefineryCMS’s scope and should I be considering just creating this site from scratch?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:45:09+00:00Added an answer on May 25, 2026 at 1:45 am

    Yes, you can add fine grain control by adding a before_filter to the appropriate refinerycms controllers. In that before_filter you could use CanCan, but refinerycms already has a roles table that you can easily leverage for this.

    Here’s one way to control access to the blog, for example.

    Using the console or other interface of your choice, add a new Role with title=”member”.

    Add another with title=”premium_user”

    Then (if your authentication model is called User), in the console

    >member1 = User.find(1)
    >member1.roles << Role.where(:title=>"member").first
    >member1.save
    

    Similarly, you would add the “premium_user” role to the right users.

    Create MyApp/lib/restrict_blog_to_member_role.rb

    module RestrictBlogToMemberRole
      def restrict_blog_to_member_role
        return true unless !(current_user.try(:has_role? "member")
        flash[:notice]="Please become a member with us before accessing the blog."
        redirect_to home_path #or some other destination path that exists
        return false
      end
    end
    

    In MyApp/config/application.rb, set up the before_filter so it will reload on each call in development mode, in case you change it with the server running….

    module MyApp
      class Application < Rails::Application
        ....
        config.before_initialize do
          require 'restrict_blog_to_member_role'
        end
        config.to_prepare do
          BlogController.send :include, RestrictBlogToMemberRole
          BlogController.send :before_filter, :restrict_blog_to_member_role
        end
        ....
      end
    end
    

    You can do the same with other refinery controllers like PagesController, Admin::BaseController, Admin::RefinerySettingsController, Admin::Blog::PostsController, etc., and add methods dealing with other roles like “premium_user”, depending on what authorization rules you want to implement.

    Alternatively, you can override the refinery controllers directly in your app/controllers folder using

    rake refinery:override controller=blog_controller #for example.
    

    Then you can incorporate calls to something like CanCan, or add the before filters above directly. If you override, it is a little harder to upgrade refinerycms when it changes, because you have the extra step of re-overriding and re-merging your code with the latest version of the controller, when it changes.

    Re: “admin” user, refinerycms is already going to leverage a role with title=”Superuser” and require that at least 1 User has that role. It comes pre-configured with some authorization logic for what Superuser can do that those without that role cannot.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.