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

  • SEARCH
  • Home
  • 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 916039
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T17:59:04+00:00 2026-05-15T17:59:04+00:00

In my app, I have a User model, which includes a number of attributes

  • 0

In my app, I have a “User” model, which includes a number of attributes including “has_admin_rights”. If true, the user is an admin, if false, they aren’t.

Each user has a profile, with their login name, email address, profile pic, etc.

If I’m logged in as a regular user, I can click on a page called “profile”, and I can edit my own account, e.g. updating my email address, profile pic, password, whatever. I can ONLY edit my account, and no other.

If I’m logged in as an admin, I can do a little more: for example, I can make ANOTHER user an admin, or take away their admin rights.

Now, only an admin has access to the view where the “make admin” check box appears, but I have a feeling that simply restricting access to the view isn’t sufficient.

What I’m concerned about is, since any user can edit their own profile, what’s there to stop a user from submitting a custom form post, which has in it the “has_admin_rights”=>”1” parameter on their own account – thereby granting themselves admin access?

What I’m thinking is that, in the User controller, before applying any changes to the “has_admin_rights” field, that I need to check to make sure the user making the request is currently an admin – otherwise I ignore the request altogether, and make no changes.

  • 1 1 Answer
  • 3 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-15T17:59:05+00:00Added an answer on May 15, 2026 at 5:59 pm

    in the User controller, before applying any changes to the “has_admin_rights” field, that I need to check to make sure the user making the request is currently an admin – otherwise I ignore the request altogether, and make no changes.

    yes, exactly. Never trust the client; remember that anybody can just tweak the page directly with Firebug or whatever.

    I’d also suggest that you consider adding an audit trail, and log something whenever one admin makes another user into an admin. Maybe also send email to all the admins for a particular group to let them know that an admin has been created (or that rights have been revoked).

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

Sidebar

Related Questions

I have a User model in my app, which I would like to store
In my current rails app, I have a User model which has_one :user_detail. Currently,
I have a Rails 3.1 app with a User model and a Venue model.
I have a Rails app, with 2 models : a User model and a
In my GWT app I have the following model class: import com.google.gwt.user.client.rpc.IsSerializable; public class
I have a data model object User . My app also has some other
In my CakePHP 1.2.5 app, I have a Profile model that belongsTo a User
I have a user profile page on my web app which has contact information.
I have a sequence of migrations in a rails app which includes the following
So I have a simple web app where I can create a user (UserModel)

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.