Skip to content

Commit

Permalink
Add permissions.
Browse files Browse the repository at this point in the history
  • Loading branch information
lewmilburn committed Jun 11, 2024
1 parent e266044 commit a6dbeaf
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Content/Text/ABOUT.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
This is the default about text for this website. You can change it in your settings.
PeopleHive is an open-source HR system designed to be simple and easy to use. This is the default about test and can be changed in your system settings.
13 changes: 13 additions & 0 deletions Processes/POST/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,18 @@
exit;
}

if (!$SQL->Query("INSERT INTO `user_permissions`
(`id`, `uuid`, `access-holidays`, `manage-vacancies`, `manage-system-settings`)
VALUES
(
NULL,
'{$SQL->Escape($uuid)}',
false,false,false
)
")) {
header('Location: /register?error=database');
exit;
}

header('Location: /login');
exit;
7 changes: 6 additions & 1 deletion Views/Dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@
<?php if ($role >= 1) { ?>
<a class="card-yellow" href="/dashboard/workplace">My Job</a>
<a class="card-yellow" href="/dashboard/documents">My Documents</a>
<?php if ($UserInfo->hasPermission('access-holidays')) { ?>
<a class="card-yellow" href="/dashboard/holidays">Holidays</a>
<?php } ?>
<?php } ?>
<a class="card-yellow" href="/jobs">Vacancies</a>
<?php if ($role >= 2) { ?>
<?php if ($UserInfo->hasPermission('manage-vacancies')) { ?>
<a class="card-yellow" href="/dashboard/jobs">Manage Vacancies</a>
<?php } if ($role >= 2) { ?>
<a class="card-yellow" href="/dashboard/department">Department Overview</a>
<a class="card-yellow" href="/dashboard/company">Company Overview</a>
<?php } if ($UserInfo->hasPermission('manage-system-settings')) { ?>
<a class="card-yellow" href="/dashboard/settings">System Settings</a>
<?php } ?>
</div>

Expand Down

0 comments on commit a6dbeaf

Please sign in to comment.