Berechtigung Schenllauswahl hinzugefügt
This commit is contained in:
@@ -44,8 +44,10 @@ import {
|
|||||||
LockKeyhole,
|
LockKeyhole,
|
||||||
PlaneIcon,
|
PlaneIcon,
|
||||||
RedoDot,
|
RedoDot,
|
||||||
|
ShieldUser,
|
||||||
Timer,
|
Timer,
|
||||||
Trash2,
|
Trash2,
|
||||||
|
Users,
|
||||||
X,
|
X,
|
||||||
} from "lucide-react";
|
} from "lucide-react";
|
||||||
import Link from "next/link";
|
import Link from "next/link";
|
||||||
@@ -155,6 +157,7 @@ export const ProfileForm: React.FC<ProfileFormProps> = ({ user }: ProfileFormPro
|
|||||||
value: key,
|
value: key,
|
||||||
}))}
|
}))}
|
||||||
/>
|
/>
|
||||||
|
<div>
|
||||||
<Select
|
<Select
|
||||||
isMulti
|
isMulti
|
||||||
form={form}
|
form={form}
|
||||||
@@ -166,6 +169,54 @@ export const ProfileForm: React.FC<ProfileFormProps> = ({ user }: ProfileFormPro
|
|||||||
value: key,
|
value: key,
|
||||||
}))}
|
}))}
|
||||||
/>
|
/>
|
||||||
|
{session.data?.user.permissions.includes("ADMIN_USER_ADVANCED") && (
|
||||||
|
<div className="mt-2 space-y-1">
|
||||||
|
<p className="text-gray-400">Berechtigung Schnellauswahl</p>
|
||||||
|
<div className="flex gap-2 justify-evenly">
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
className="btn btn-sm btn-outline"
|
||||||
|
onClick={() =>
|
||||||
|
form.setValue("permissions", ["LOGIN_NEXTCLOUD", "PILOT", "DISPO", "AUDIO"], {
|
||||||
|
shouldDirty: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onSubmit={() => false}
|
||||||
|
>
|
||||||
|
<Users size={14} /> Community-Guide
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="btn btn-sm btn-outline btn-warning"
|
||||||
|
onClick={() =>
|
||||||
|
form.setValue(
|
||||||
|
"permissions",
|
||||||
|
["LOGIN_NEXTCLOUD", "PILOT", "DISPO", "AUDIO", "ADMIN_KICK", "ADMIN_USER"],
|
||||||
|
{
|
||||||
|
shouldDirty: true,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
onSubmit={() => false}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<Eye size={14} /> Supervisor
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="btn btn-sm btn-outline btn-error"
|
||||||
|
onClick={() =>
|
||||||
|
form.setValue("permissions", Object.values(PERMISSION), {
|
||||||
|
shouldDirty: true,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
onSubmit={() => false}
|
||||||
|
type="button"
|
||||||
|
>
|
||||||
|
<ShieldUser size={14} /> Administrator
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
<div className="card-actions justify-center pt-6">
|
<div className="card-actions justify-center pt-6">
|
||||||
<Button
|
<Button
|
||||||
role="submit"
|
role="submit"
|
||||||
|
|||||||
Reference in New Issue
Block a user