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 7678937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T17:45:39+00:00 2026-05-31T17:45:39+00:00

My question is : I have a domain table in database, where I add

  • 0

My question is :

I have a domain table in database, where I add some rules for users.

Something like this:

Table UserRoles:

idRule cRuleDescription bRuleIsActive
1   Edit client      true
2   Delete client    false

My C# application refers to this table using enumeration, like this :

public enum UserRoles: int
{
    CanEditClient = 1,
    CanDeleteClient = 2,
    CanChangeClientName = 3,

    //More code
}

And I use a C# method that query the database, by its Id, to know if the logged user has permission for some action. Something like this:

bool HasPermissionToEdit = Rules.UserHasPermisson(UserName, UserRoles.CanEditClient)

if(HasPermissionToEdit)
{
  //Do the work!
}

But using this gives me some trouble. Someone created new rows in a production eviroment on database. And the ids are not correct anymore. And I’ll need to change the enumeration on my C# code. I need to use this table because, administration users can manage the rules for other group of users.

How do you work with it? There is a better way to reference a registry on a table?

  • 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-31T17:45:41+00:00Added an answer on May 31, 2026 at 5:45 pm

    Using the rule ID to map to an enum is not crazy in itself as long as the rule ID is not automatically generated (i.e. not an identiy column).

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

Sidebar

Related Questions

I have a question, I have a database with some webshop products. I load
I have one question regarding domain account. I have one domain controller where all
This question is about App domains and Sessions. Is it possible to have IIS
The responses I've got to this question have solved the problem I had in
No doubt elements of this question have been asked before, but I'm having trouble
Question: I have a question that is apparently not answered by this already-asked Bash
I have an ad network script like the following http://cdn.domain.com/ad.php?variables=etc We have about 10,000
I have an applicaton that contains some tables that are auto-generated from Grails domain
Ok, I have an app as described in this post: https://stackoverflow.com/questions/1623105/good-database-structure-for-a-new-web-app I've prepared a
Although this question fancies PostgreSQL, it is still a general DB question. I have

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.