Skip to content
This repository was archived by the owner on Nov 1, 2024. It is now read-only.

Commit 00e9f05

Browse files
authored
Merge pull request #26 from navikt/deny-all-users-on-pii-dp
feat: do not show all users option when granting access to pii dp
2 parents f14ea2f + 63622c2 commit 00e9f05

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

components/dataproducts/access/newAccessForm.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ interface NewAccessFormProps {
3333
open: boolean,
3434
setOpen: Dispatch<SetStateAction<boolean>>,
3535
id: string
36+
pii: boolean
3637
}
3738

38-
const NewAccessForm = ({ open, setOpen, id }: NewAccessFormProps) => {
39+
const NewAccessForm = ({ open, setOpen, id, pii }: NewAccessFormProps) => {
3940
const [formError, setFormError] = useState('')
4041

4142
const [date, setDate] = useState<Date | null>(endOfDay(new Date()))
@@ -163,11 +164,11 @@ const NewAccessForm = ({ open, setOpen, id }: NewAccessFormProps) => {
163164
name='subjectType'
164165
render={({ field }) => (
165166
<RadioGroup {...field}>
166-
<FormControlLabel
167+
{!pii && <FormControlLabel
167168
value='all-users'
168169
control={<Radio />}
169170
label='Alle i NAV'
170-
/>
171+
/>}
171172
<FormControlLabel
172173
value='group'
173174
control={<Radio />}

components/dataproducts/access/owner.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const Owner = ({ accessQuery }: OwnerProps) => {
3636
<AccessList id={dataproduct.id} access={dataproduct.access} requesters={dataproduct.requesters} />
3737
<SubHeader onClick={() => setShowExpired(!showExpired)}>Utløpte tilganger {showExpired ? <Collapse /> : <Expand />}</SubHeader>
3838
{showExpired && <ExpiredAccessList access={dataproduct.access} />}
39-
<NewAccessForm open={open} setOpen={setOpen} id={dataproduct.id} />
39+
<NewAccessForm open={open} setOpen={setOpen} id={dataproduct.id} pii={dataproduct.pii} />
4040
</>
4141
)
4242
}

lib/queries/access/dataproductAccess.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const GET_DATAPRODUCT_ACCESS = gql`
55
dataproduct(id: $id) {
66
id
77
name
8+
pii
89
owner {
910
group
1011
teamkatalogenURL

lib/schema/graphql.ts

+2
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,7 @@ export type DataproductAccessQuery = {
676676
__typename?: 'Dataproduct'
677677
id: string
678678
name: string
679+
pii: boolean
679680
requesters: Array<string>
680681
owner: {
681682
__typename?: 'Owner'
@@ -1209,6 +1210,7 @@ export const DataproductAccessDocument = gql`
12091210
dataproduct(id: $id) {
12101211
id
12111212
name
1213+
pii
12121214
owner {
12131215
group
12141216
teamkatalogenURL

0 commit comments

Comments
 (0)