File tree Expand file tree Collapse file tree 9 files changed +19
-8
lines changed
Expand file tree Collapse file tree 9 files changed +19
-8
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ Dates should be in`YYYY-MM-DD` format and versions are in [semantic versioning](
88### Fixed
99
1010- No italics on tip bulb.
11+ - Improved no access error messages.
1112
1213### Maintenance
1314
Original file line number Diff line number Diff line change 11{
22 "name" : " adminima" ,
3- "version" : " 0.8.5 " ,
3+ "version" : " 0.8.6 " ,
44 "private" : true ,
55 "scripts" : {
66 "dev" : " vite dev" ,
Original file line number Diff line number Diff line change 11import Organization from '$database/Organization.js' ;
2+ import { noAccess } from '$types/Locales.js' ;
23import { error } from '@sveltejs/kit' ;
34
45export async function load ( { parent, params } ) {
@@ -14,7 +15,7 @@ export async function load({ parent, params }) {
1415
1516 if ( change === null || roles === null || profiles === null || processes === null )
1617 error ( 404 , {
17- message : "This change doesn't exist or isn't visible to you."
18+ message : noAccess ( ' change' )
1819 } ) ;
1920
2021 return {
Original file line number Diff line number Diff line change 11import Organization from '$database/Organization' ;
2+ import { noAccess } from '$types/Locales' ;
23import { error } from '@sveltejs/kit' ;
34
45export async function load ( { parent } ) {
@@ -14,7 +15,7 @@ export async function load({ parent }) {
1415
1516 if ( roles === null || profiles === null || assignments === null || teams === null )
1617 error ( 404 , {
17- message : "This role doesn't exist or isn't visible to you."
18+ message : noAccess ( 'person list' )
1819 } ) ;
1920
2021 return {
Original file line number Diff line number Diff line change 11import Organization from '$database/Organization' ;
2+ import { noAccess } from '$types/Locales.js' ;
23import { error } from '@sveltejs/kit' ;
34
45export async function load ( { parent, params } ) {
@@ -29,7 +30,7 @@ export async function load({ parent, params }) {
2930 changes === null
3031 )
3132 error ( 404 , {
32- message : "This profile doesn't exist or isn't visible to you."
33+ message : noAccess ( ' profile' )
3334 } ) ;
3435
3536 return {
Original file line number Diff line number Diff line change 11import Organization from '$database/Organization' ;
2+ import { noAccess } from '$types/Locales.js' ;
23import { error } from '@sveltejs/kit' ;
34import { validate as isValidUUID } from 'uuid' ;
45
@@ -11,7 +12,7 @@ export async function load({ parent, params }) {
1112
1213 if ( process === null )
1314 error ( 404 , {
14- message : "This process either isn't visible to you or doesn't exist."
15+ message : noAccess ( ' process' )
1516 } ) ;
1617
1718 const [
@@ -39,7 +40,7 @@ export async function load({ parent, params }) {
3940 profiles === null
4041 )
4142 error ( 404 , {
42- message : "This process either isn't visible to you or doesn't exist."
43+ message : noAccess ( ' process' )
4344 } ) ;
4445
4546 return {
Original file line number Diff line number Diff line change 11import Organization from '$database/Organization' ;
2+ import { noAccess } from '$types/Locales.js' ;
23import { error } from '@sveltejs/kit' ;
34import { validate as isValidUUID } from 'uuid' ;
45
@@ -35,7 +36,7 @@ export async function load({ parent, params }) {
3536 hows === null
3637 )
3738 error ( 404 , {
38- message : "This role doesn't exist or isn't visible to you."
39+ message : noAccess ( ' role' )
3940 } ) ;
4041
4142 return {
Original file line number Diff line number Diff line change 11import Organization from '$database/Organization' ;
2+ import { noAccess } from '$types/Locales.js' ;
23import { error } from '@sveltejs/kit' ;
34
45export async function load ( { parent, params } ) {
@@ -11,7 +12,7 @@ export async function load({ parent, params }) {
1112
1213 if ( team === null || roles === null )
1314 error ( 404 , {
14- message : "This team doesn't exist or isn't visible to you."
15+ message : noAccess ( ' team' )
1516 } ) ;
1617
1718 return {
Original file line number Diff line number Diff line change @@ -35,3 +35,7 @@ export type Locale = {
3535 noTeam : string ;
3636 } ;
3737} ;
38+
39+ export function noAccess ( type : string ) {
40+ return `This ${ type } either isn't visible to you or doesn't exist. Expect to have access? Make sure you're logged in.` ;
41+ }
You can’t perform that action at this time.
0 commit comments