implemented
This commit is contained in:
parent
40ca82bb45
commit
409e0df9a6
16 changed files with 2451 additions and 4 deletions
|
|
@ -12,10 +12,11 @@ export default function SumPage() {
|
|||
const [result, setResult] = useState<number | null>(null);
|
||||
const [showResult, setShowResult] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const { user, isLoading, logout, hasPermission } = useAuth();
|
||||
const { user, isLoading, logout, hasPermission, hasRole } = useAuth();
|
||||
const router = useRouter();
|
||||
|
||||
const canUseSum = hasPermission(Permission.USE_SUM);
|
||||
const isRegularUser = hasRole("regular");
|
||||
|
||||
useEffect(() => {
|
||||
if (!isLoading) {
|
||||
|
|
@ -82,6 +83,12 @@ export default function SumPage() {
|
|||
<a href="/" style={styles.navLink}>Counter</a>
|
||||
<span style={styles.navDivider}>•</span>
|
||||
<span style={styles.navCurrent}>Sum</span>
|
||||
{isRegularUser && (
|
||||
<>
|
||||
<span style={styles.navDivider}>•</span>
|
||||
<a href="/profile" style={styles.navLink}>My Profile</a>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
<div style={styles.userInfo}>
|
||||
<span style={styles.userEmail}>{user.email}</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue