Module — Administration¶
The configuration and governance layer of the ERP. It manages user groups and permission keys, per-user data scoping, the organisational structure (branches, departments, positions, the level/step salary matrix), reference / lookup data, the work calendar, system settings (role-holder assignments, cash-box figures, the attendance IP allow-list), announcements, the activity-log / audit history, and a few cross-module operational tools. It also hosts the public anonymous portals used by suppliers and job candidates.
Source: NKO.Main/NKO.Main/Controllers/{Admin,User,Apps,General,Home,Error}Controller.cs,
NKO.Lib/NKO.Shared/Helpers/{BUser,BNotification}.cs,
NKO.Lib/NKO.Shared/BAL/{Bsettings,BSign,BCalendar,SharedBAL,Permissionchecker}.cs,
NKO.Main/NKO.Main/BAL/{BCommon,BGeneral,BAnnouncement,BBranch,BNote}.cs,
NKO.Main/NKO.Main/{Infrastructure,ScheduledTasks}/.
Purpose & scope¶
- In scope: everything that configures how the rest of the system behaves — roles/permissions, org tree, calendars, reference data, settings, announcements, audit trail, and the tools that bulk-reassign or recompute pending approvals.
- Out of scope: the business workflows themselves (see the other module pages) and the authentication mechanics (see Authentication).
- Database:
NKO_DB(core), contextNKO_DBEntities1.
Key features¶
- Groups & permissions — create groups (roles); attach
AppPermissionkeys to a group; assign members and toggleIsEnable; per-user data-scope (All / Location / Custom branch list / Default) perSharedPermissionsarea; per-user project and group membership. See Permissions. - Identity administration — user list / details / activity history; enable-login toggle and password reset / generate; PIN enable / disable; the "updated users" review queue.
- Organisation structure — positions (+ attachments, + interview questions), hierarchical departments with a manager position, branches & sub-branches, and the salary Levels / Steps / matrix per calendar profile.
- Reference / lookup data — programs, donors, budget-line categories, and the
Common*lookups (countries, degrees, units, languages, education, …). - Work calendar — calendar profiles per branch (auto-creates 7 day rows), weekend / half-day flags per day, and special holidays with repeat / half-day / per-profile scope.
- System settings — 21
CommonSettingrows: role holders (Procurement Manager, HR Approval, Director Approval, Payroll Allocator, Finance Data Officer, Timesheet FO / Payer, Travel FO and Safety Officer, IT, Administration and Supply-Chain managers, Complaint and Compliance admins, project focal points), the ordinary / emergency cash-box amounts, the e-mail-service on/off switch, and the attendance IP allow-list. Not here: the HR manager, finance manager and general manager that most approval chains route to — those are found by position title (R6-10). The screen's own "HR Manager" field is saved but never read. The rows must already exist — the screen cannot create them (R5-5). - Announcements — targeted by branch / sub-branch / level / direct-vs-core, immediate or scheduled; on publish, matching employees are notified + e-mailed; shown on the home dashboard.
- Login history — filter
UpdatedUserrows by user / method / subsystem / text / date. Despite the table's generic columns, the only code that writes to it isBUser.SetCustomTracking, called on successful sign-in — so it records logins, not changes; export to Excel (delivered over SignalR by a background job). - Cross-module operations — bulk-reassign every workflow item currently waiting on one user to another; manually trigger the nightly next-user recompute.
- Public portals (
AppsController, anonymous) — suppliers answer an RFQ, candidates apply to a job, referees submit a reference.
Screens¶
Route = /{Controller}/{Action}. GET unless noted; only primary screens are listed (each also has
add / edit / delete partials under the same permission key).
Groups, permissions & users¶
| Feature | Route | View | Permission key |
|---|---|---|---|
| Groups (roles) list | / |
Admin/ |
Admin |
| Attach permission keys to a group | / |
Admin/ |
Admin |
Group members (+ Is) |
/ |
Admin/ |
User |
| Per-user permission overrides | / |
Admin/ |
Admin |
Data-scope per Shared area |
/ |
Admin/ |
Admin |
| User list / details / dashboard / history | /, /, /, / |
User/ |
User, User, User |
| Enable login / reset password | /, /, / |
User/ |
User, User, User |
| Membership (groups + project rights) | /, /, / |
User/ |
User, User, User |
| Disable PIN | / |
— | User |
| "Updated users" queue | / |
User/ |
User |
Organisation, reference data & calendar¶
| Feature | Route | Permission key |
|---|---|---|
| Positions (+ attachments, + questions) | /, /, / |
Admin, Admin |
| Departments (hierarchical) | / |
Admin |
| Branches & sub-branches | /, / |
Admin |
| Salary levels / steps / matrix | /, / |
Admin, Admin |
| Programs / Donors / Budget-line categories | /, /, / |
Admin, Admin, Admin / Project |
| Calendar profiles / day config | /, / |
Admin, Admin |
| Special holidays | / |
Admin |
Settings, announcements, audit & tools¶
| Feature | Route | Permission key |
|---|---|---|
| Admin landing (tiles) | / |
Admin |
| General settings (role holders, cash boxes, IPs, e-mail switch) | / |
Admin |
| Announcements | / |
Admin |
| Activity log / audit history (+ Excel export) | / |
Admin |
| Bulk-reassign one user's pending approvals | / |
Admin |
| Trigger next-user recompute | /, / |
Admin |
| Staff directory / org chart | /, /, / |
Home |
| Home dashboard | / or / |
Home |
| Public portals (anonymous) | / (RFQ), /, / |
(none — anonymous, [Validate) |
Business logic¶
| Class | File | Responsibility & notable methods |
|---|---|---|
BUser |
NKO. (~1900 ln) |
The catch-all employee/org service. Get → Permission (Data All/Location/Custom/Default + optional project rows). System-role resolvers: Get, Get, Get, Get, Get, Get, Get, Get, Get. Org tree: Get, Get, Get. Contract/salary: Get, Get, Get. Identity: Reset, Verify, Change, Set (writes the Updated audit rows). Audit query builder Get + Export. |
Bsettings |
NKO. (~400 ln) |
Common reader/writer. Save updates rows by numeric Setting 1–21 and never inserts; Get → General reads them by list position (settings[0…20], no ORDER BY) and returns null if any is missing (R5-5). Setting 8 ("Director Approval") is also the SRF country-director step's approver, via Get. Getters Get, Get, Get, Get, Get, Get, Get, … Get / Set — the per-area running counter (Common) that produces document reference numbers. |
BSign |
NKO. (~340 ln) |
E-signature lifecycle. Has — true only for an App that is Sign and within Approve (the gate used by procurement, the warehouse flows, leave, advance and overtime — but not by payroll, training, jobs, evaluation, PO justification or destruction, R3-9). Create (notifies HR), Approve (expires the user's other open signs), Reject, Get, Get. |
BAnnouncement |
NKO. |
Announce(id) — resolves recipients from Announcement (branch / sub-branch / level, optional direct-vs-core) against db., then BNotification. (public) + e-mail body. |
BNotification |
NKO. |
Notify(content — one Notification + one Notification per recipient (Is). |
BCalendar |
NKO. |
Per-profile calendar queries: Is, Get (expands Is into the current year), Get (from Calender). |
Staff |
NKO. |
Org-hierarchy walker over Manager / Tech (skips Is): Get, Get, Get, Is. Resolves "waiting for manager" and Data scoping. |
Shared |
NKO. |
Get, Get (advance = ½ net; loan tenure rules) — see Payroll. Get here duplicates BLeave.. |
BCommon, BGeneral, BBranch, BNote |
NKO. |
Lookup helpers (project/donor/branch/unit/department code lookups, Get), the staff directory (BGeneral.), branch/sub-branch reads, and generic (Area notes with reminder dates. |
Background jobs¶
| Job | File | Schedule | Effect |
|---|---|---|---|
Birthday |
Infrastructure/ |
IHosted, 0 9 * * * (09:00 daily); skipped if inactive |
BUser. → bilingual "Happy Birthday" e-mail each. |
Update |
Scheduled |
Quartz 0 0 3 ? * * (03:00 daily) and on demand from / |
Recomputes Next for every non-final pending request (Advance, Training, Leave, Timesheet, Payroll, PR, PO, GRN, SRR, Maintenance, Asset-GRN …) via Next, so approvals re-route when managers or settings change. |
Export |
Scheduled |
Quartz durable, no schedule — triggered from / |
Builds the activity-log Excel export and pushes a download link over SignalR. |
LoanJob (Infrastructure/LoanJob.cs) exists but is never registered and returns immediately in
DEBUG — dead code.
Data¶
- Permissions:
AppPermission,AppUserGroup,AppUserGroupMember,AppUserGroupPermission,AppUserProjectPermission,CommonPermission,CommonSharedPermission,SharedPermissionBranch. - Notifications:
Notification,NotificationUser,NotificationType,NotificationActionType. - Audit & archive:
UpdatedUser,ArchiveFile,ArchiveFileType. - Reference / lookup: all
Common*(CommonBranch,CommonSubBranch,CommonDepartment,CommonCategory,CommonMainCategory,CommonSubCategory,CommonCountry,CommonDegree,CommonUnit,CommonLanguageLevel,CommonMajorEducation,CommonGeneralLevel,CommonProgram,CommonManagers,CommonSetting,CommonIncrement),Nationality,Governorate,District. - Org structure:
PositionLevel,PositionLevelMatrix,PositionLevelStep,PositionStep,PositionQuestion,AppUserPosition. - Calendar:
CalendarProfile,CalenderConfiguration,CalendayDays,SpecialHoliday. - Announcements:
Announcements,AnnouncementRecipient.
Full column detail: Administration database.
Permissions¶
Distinct [ClaimRequirement] keys used by this module: AdminIndex, AdminGeneralSettings,
AdminAnnouncement, AdminDeleteAnnouncement, AdminUserGroups, AdminAddUserGroup,
AdminUserGroupEdit, UserUserGroupUsers, AdminUserPositions, AdminAddUserPosition,
AdminManageTeam, AdminAddUserTeam, AdminUserTeams, AdminDepartments, AdminLocations,
AdminLevels, AdminPrograms, AdminDonors, AdminCategories, ProjectCategory, UserIndex,
UserUpdatedUser, UserDashboard, UserViewUser, UserEdit, UserChangePassword,
UserPermission, UserManagePermission, UserMembership, UserManageGroupMember, HomeIndex,
HomeAnnouncement, General. AppsController actions carry no key (anonymous public).
/Admin/CopyProfile is currently unguarded.
Screenshots¶
User groups — /Admin/UserGroups:

Permission keys on a group — /Admin/UserGroupEdit/{id}:

Per-user data scope for an area — /Admin/UserSharedPermissions:

Control Panel landing — /Admin/Index:

General Settings — /Admin/GeneralSettings (system role-holder assignments, document-number
increments, cash-box balances, IP / attendance settings):

Related¶
- Permissions · Authentication — how these settings are enforced.
- HR module — the org structure and calendars configured here drive HR.
- Administration API · Administration database.
- Security & Permissions.