Need help with creating classes to hold user data

I am trying to create a class, or set of classes, wherein one class will contain code for user login (user ID and password will pull up the user name, and button to accept user ID for login purposes).

I need to be able to create a class that will hold up to 50 users (plus one additional user preset as Admin). This class will allow only the Admin to Add or Delete users, and only the Admin can change user permissions for the program. Users can "edit" their password only. NOTE: Users will also be included in the Employee data (except for a certain type of user (such as an External Accountant). The total number of permissions available to each user will upwards of 300. Permissions will be setup in "Roles". Each "Role" will have a variable number of permissions assigned to it, and each user that is assigned to this "Role" can be assigned or restricted from access to "Permissions" within the "Role".

I am using Microsoft Visual Studio 2015 (if this helps).

I forgot to mention that I am working on a Windows 7 machine, so I need to be able to write code that works in Windows 7, and will also work in Windows 8 (and other platforms, such as Web and Android, etc.).

I am working on the header file. I am getting error messages saying identified "string" is not defined. This is just partial code. I need to create a Windows Form that will allow users to login. I also need to create a Windows Form that will allow the Admin to add, delete, and edit users permissions

My code (partial) is below:

#pragma once

struct Roles
{
// The Roles are flexible and easy to customize:
// * Multiple roles can be assigned to a single user.
// * A single role can be assigned to multiple users.
// * Roles can be created from scratch
// * User roles can be copied and customized to fit the needs of the business. Modifying controls with user-roles model is easier
// especially if your clients have multiple users assigned to a single role. Clients no longer have to change controls for each
// user. Just change the permissions to the role and the user(s) controls will be updated automatically

string Admin = "Admin"; // Admin - Full access to all areas of the company file. (Usually assigned to one user only.)
string Accounting; // Accounting role - This role is designed for your bookkeeping or accounting staff. Access to
// areas/activities such as Journal Entries, Chart of Accounts, Setting Closing Date & Password,
// Accountant & Taxes and Company & Financial reports.
// Specific permissions under Accounting include the following: Accounting Tools; Asset Registers; Edit Closed Transactions; Equity
// Registers; General Journal; Liability Registers; Manage Fixed Assets; Working Trial Balance.
// If Accounting RadioButton is checked, Area Access Level options are: None, Full, and Partial.
// Under Partial: CheckBoxes allow you to choose between View; Create; Modify; Delete; Print; and View Balance (grayed out).
// If Accounting Tools RadioButton is Checked, Activity Access Levels available (RadioButtons) are None and Full.
// If Asset Registers RadioButton is checked, Activity Access Level options are: None, Full, and Partial.
// Under Partial: CheckBoxes allow you to choose between View and Print. Create, Modify, Delete, and View Balance are grayed out.


string AcctsPay; // Accounts Payable - This role is designed for your Accounts Payable staff members.
// Access to areas/activities such as entering and paying bills, Purchase Orders,
// and Vendors & Payables reports.
string AcctsRecv; // Accounts Receivable - This role is designed for your Accounts Receivable staff members.
// Access to areas/activities such as Invoices, Receive Payments, Statements, Credit Memos,
// and Customers & Receivables reports.
string Banking; // Banking - This role is designed for your staff members who need access to areas/activities such as
// bank registers, checks, deposits, credit card charges, Reconcile, and Banking reports.
string extAccountant; // External Accountant - Full access to all areas of QuickBooks except sensitive customer data, such as
// credit card numbers.
String Finance; // Finance - This role is designed for your finance staff members who need to be able to view most financial
// data. Access to areas/activities such as Planning & Budgeting, bank registers, asset, equity, and
// liability accounts, and Company & Financial reports.
string FullAccess; // Full Access - This role is designed for staff members who need full access to the company file with the
// exception of access to Clean Up Company Data, importing and exporting data, Working Trial Balance,
// managing fixed assets and setting file Closing Date & Password.
string Inventory; // Inventory - This role is designed for your staff members who work with inventory. Access to
// areas/activities such as Adjusting Quantities on Hand, Build Assemblies, Item Receipts, and Inventory
// reports.
string PayrollMgr; // Payroll Manager - This role is designed for a Payroll Manager who needs full access to payroll functions
// such as the Employee Organizer, paychecks, employee and paycheck information, and payroll adjustments.
string PayrollProc; // Payroll Processor - This role is designed for your staff members who process payroll checks and payroll
// liabilities. It does not allow access to the Employee Organizer.
string Purchasing; // Purchasing - This role is designed for your purchasing staff members who need access to Purchase Orders
// and Purchases reports.
string Sales; // Sales - This role is designed for your sales staff members who need access to Sales Orders, Sales Receipts,
// Sales reports, Estimates, and all information in the Customer list.
string TimeTracking; // Time Tracking - This role is designed for your staff members who need to work with Time Tracking functions
// such as importing and exporting Timer data, Single Time Activity tracking, Time reports, and the
// Weekly Timesheet.
string ViewOnly; // View-Only - This role is designed for "view-only" access to most areas of the company file. Creating,
// modifying, deleting, and printing are not allowed.
};

struct Users
{
// Define Users Variables
int UserNumber;
string UserName;
string UserID;
string UserPassword;
};
Last edited on
Since you say this is is partial code, it's not clear if:
1) you've included the <string> header or not.
2) you've included using namespace std;

Failing to include either of those will cause the compiler to complain that it doesn't recognize "string".

PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your post.
http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <> formatting button.



Topic archived. No new replies allowed.