Skip to content

Commit

Permalink
fix: export default project constant
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikOseberg authored and ivarconr committed Jan 11, 2022
1 parent f39f1ea commit a723004
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/lib/db/access-store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
ENVIRONMENT_PERMISSION_TYPE,
ROOT_PERMISSION_TYPE,
} from '../util/constants';
import { DEFAULT_PROJECT } from 'lib/services/project-service';

const T = {
ROLE_USER: 'role_user',
Expand Down Expand Up @@ -130,7 +131,7 @@ export class AccessStore implements IAccessStore {
// we map the project to the project and environment specific
// permissions that are connected to the editor role.
if (row.role_id === EDITOR_ID && row.type !== ROOT_PERMISSION_TYPE) {
project = 'default';
project = DEFAULT_PROJECT;
} else if (row.type !== ROOT_PERMISSION_TYPE) {
project = row.project ? row.project : undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/services/project-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import IncompatibleProjectError from '../error/incompatible-project-error';

const getCreatedBy = (user: User) => user.email || user.username;

const DEFAULT_PROJECT = 'default';
export const DEFAULT_PROJECT = 'default';

export interface UsersWithRoles {
users: IUserWithRole[];
Expand Down

0 comments on commit a723004

Please sign in to comment.