security: hide system bot join mode for non-SysAdmin users
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
41a4e8ffe1
commit
9793360235
1 changed files with 5 additions and 1 deletions
|
|
@ -3,6 +3,7 @@ import { useNavigate } from 'react-router-dom';
|
|||
import { useCurrentInstance } from '../../../hooks/useCurrentInstance';
|
||||
import * as teamsbotApi from '../../../api/teamsbotApi';
|
||||
import type { TeamsbotSession, StartSessionRequest, TeamsbotJoinMode } from '../../../api/teamsbotApi';
|
||||
import { getUserDataCache } from '../../../utils/userCache';
|
||||
import styles from './Teamsbot.module.css';
|
||||
|
||||
/**
|
||||
|
|
@ -14,6 +15,9 @@ export const TeamsbotDashboardView: React.FC = () => {
|
|||
const instanceId = instance?.id || '';
|
||||
const navigate = useNavigate();
|
||||
|
||||
const cachedUser = getUserDataCache();
|
||||
const _isSysAdmin = cachedUser?.isSysAdmin === true;
|
||||
|
||||
const [sessions, setSessions] = useState<TeamsbotSession[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
|
|
@ -154,7 +158,7 @@ export const TeamsbotDashboardView: React.FC = () => {
|
|||
onChange={(e) => setJoinMode(e.target.value as TeamsbotJoinMode)}
|
||||
disabled={isStarting}
|
||||
>
|
||||
<option value="systemBot">System-Bot (authentifiziert)</option>
|
||||
{_isSysAdmin && <option value="systemBot">System-Bot (authentifiziert)</option>}
|
||||
<option value="anonymous">Anonymer Gast</option>
|
||||
<option value="userAccount">Mein Account</option>
|
||||
</select>
|
||||
|
|
|
|||
Loading…
Reference in a new issue