Skip to content

Commit

Permalink
Feat/Security permission (#407)
Browse files Browse the repository at this point in the history
* place field for single custom badge

* feat: add "Premier secours" permission option in UserModal

* s

---------

Co-authored-by: Antoine D <[email protected]>
  • Loading branch information
Suboyyy and Antoine D authored Oct 31, 2024
1 parent 262f79f commit d2723e8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/(dashboard)/admin/genbadge/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,15 @@ const GenBadges = () => {
]}
required
/>
<Input
label="Place"
value={fields![i]?.place}
onChange={(e) => {
const newFields = [...fields!];
newFields[i] = { ...newFields[i], place: e };
setFields(newFields);
}}
/>
</>
)}

Expand Down
1 change: 1 addition & 0 deletions src/components/dashboard/UserModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ const permissionOptions = [
{ name: 'Vestiaire', value: Permission.repo.toString() },
{ name: 'Animation', value: Permission.anim.toString() },
{ name: 'Admin', value: Permission.admin.toString() },
{ name: 'Premiers secours', value: Permission.firstaid.toString() },
];

const typeOptions = [
Expand Down
2 changes: 2 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export enum Permission {
admin = 'admin',
repo = 'repo',
orga = 'orga',
firstaid = 'firstaid',
}

export interface Team {
Expand Down Expand Up @@ -308,6 +309,7 @@ export type BadgeType = 'orgas' | 'custom' | 'single' | 'singlecustom';
export type BadgePermission = 'restricted' | 'orgaprice' | 'fullaccess' | 'invite';

export interface Badge {
place?: string;
type: BadgeType;
name?: string;
permission?: BadgePermission;
Expand Down

0 comments on commit d2723e8

Please sign in to comment.