Skip to content

Commit

Permalink
fix: deactivate read only mode
Browse files Browse the repository at this point in the history
  • Loading branch information
NilsOveTen committed Dec 10, 2024
1 parent 730007d commit 3eda657
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 14 deletions.
4 changes: 0 additions & 4 deletions src/lib/auth/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,6 @@ export class Auth {
hasOrganizationAdminPermission = (orgNr: string) =>
this.hasOrganizationRole({ orgNr, role: 'admin' });

isReadOnlyUser = (orgNr: string) =>
this.hasOrganizationReadPermission(orgNr) &&
!this.hasOrganizationWritePermission(orgNr);

hasSystemAdminPermission = () =>
this.hasResourceRole({
resource: 'system',
Expand Down
11 changes: 3 additions & 8 deletions src/lib/concept/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
import {Concept} from '../../types';
import { Concept } from '../../types';

export const isConceptEditable = (concept: Concept | undefined) => {
if (concept == null) {
return false;
}
const { id, erPublisert } = concept;
return id == null || !erPublisert;
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const isConceptEditable = (_: Concept | undefined) => true;
3 changes: 1 addition & 2 deletions src/pages/concept-registration-page/form-concept/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { Can } from '../../../casl/Can';
import { deepKeys } from '../../../lib/deep-keys';
import { getTranslateText } from '../../../lib/translateText';
import { localization } from '../../../lib/localization';
import { authService } from '../../../services/auth-service';

import { useAppSelector, useAppDispatch } from '../../../app/redux/hooks';
import { setLanguage, toggleLanguage } from '../../../features/language';
Expand Down Expand Up @@ -154,7 +153,7 @@ export const FormConceptPure: FC<Props> = ({
}, [concept]);

const publisherId = concept?.ansvarligVirksomhet?.id;
const isReadOnly = authService.isReadOnlyUser(publisherId);
const isReadOnly = false;

const [expandAll, setExpandAll] = useState(false);
const [isExpandAllDirty, setExpandAllDirty] = useState(false);
Expand Down

0 comments on commit 3eda657

Please sign in to comment.