Skip to content

Commit

Permalink
Add Role and Permissions interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Oct 20, 2024
1 parent ae175c0 commit 06d991d
Show file tree
Hide file tree
Showing 6 changed files with 105 additions and 2 deletions.
11 changes: 10 additions & 1 deletion app/assets/interfaces/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
import type { LoginForm } from './loginForm'
import type { UserInterface } from './userInterface'
import type { GroupInterface } from './groupInterface'
import type { RoleInterface } from './roleInterface'
import type { PermissionInterface } from './permissionInterface'
import type { RouteGuard } from './routes'

export type { LoginForm, UserInterface, GroupInterface, RouteGuard }
export type {
GroupInterface,
LoginForm,
PermissionInterface,
RoleInterface,
RouteGuard,
UserInterface
}
24 changes: 24 additions & 0 deletions app/assets/interfaces/permissionInterface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* By default, the frontend role object will have the same interface as the PHP user.
* Note that any Sprinkle can (and should!) extend this interface.
*
* Example:
* - id: 1
* - slug: "show_hippo"
* - name: "Show Hippopotamus"
* - conditions: "always()"
* - description: "This permission let you display any hippopotamus."
* - created_at: "2023-09-16T19:23:59.000000Z"
* - updated_at: "2023-09-16T19:23:59.000000Z"
* - deleted_at: null
*/
export interface PermissionInterface {
id: number
slug: string
name: string
conditions: string
description: string
created_at: Date | string
updated_at: Date | string
deleted_at: Date | string | null
}
22 changes: 22 additions & 0 deletions app/assets/interfaces/roleInterface.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* By default, the frontend role object will have the same interface as the PHP user.
* Note that any Sprinkle can (and should!) extend this interface.
*
* Example:
* - id: 1
* - slug: "hippo"
* - name: "Hippopotamus Role"
* - description: "The role applied to all hippopotamus."
* - created_at: "2023-09-16T19:23:59.000000Z"
* - updated_at: "2023-09-16T19:23:59.000000Z"
* - deleted_at: null
*/
export interface RoleInterface {
id: number
slug: string
name: string
description: string
created_at: Date | string
updated_at: Date | string
deleted_at: Date | string | null
}
4 changes: 3 additions & 1 deletion dist/interfaces/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { LoginForm } from './loginForm';
import { UserInterface } from './userInterface';
import { GroupInterface } from './groupInterface';
import { RoleInterface } from './roleInterface';
import { PermissionInterface } from './permissionInterface';
import { RouteGuard } from './routes';
export type { LoginForm, UserInterface, GroupInterface, RouteGuard };
export type { GroupInterface, LoginForm, PermissionInterface, RoleInterface, RouteGuard, UserInterface };
24 changes: 24 additions & 0 deletions dist/interfaces/permissionInterface.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* By default, the frontend role object will have the same interface as the PHP user.
* Note that any Sprinkle can (and should!) extend this interface.
*
* Example:
* - id: 1
* - slug: "show_hippo"
* - name: "Show Hippopotamus"
* - conditions: "always()"
* - description: "This permission let you display any hippopotamus."
* - created_at: "2023-09-16T19:23:59.000000Z"
* - updated_at: "2023-09-16T19:23:59.000000Z"
* - deleted_at: null
*/
export interface PermissionInterface {
id: number;
slug: string;
name: string;
conditions: string;
description: string;
created_at: Date | string;
updated_at: Date | string;
deleted_at: Date | string | null;
}
22 changes: 22 additions & 0 deletions dist/interfaces/roleInterface.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* By default, the frontend role object will have the same interface as the PHP user.
* Note that any Sprinkle can (and should!) extend this interface.
*
* Example:
* - id: 1
* - slug: "hippo"
* - name: "Hippopotamus Role"
* - description: "The role applied to all hippopotamus."
* - created_at: "2023-09-16T19:23:59.000000Z"
* - updated_at: "2023-09-16T19:23:59.000000Z"
* - deleted_at: null
*/
export interface RoleInterface {
id: number;
slug: string;
name: string;
description: string;
created_at: Date | string;
updated_at: Date | string;
deleted_at: Date | string | null;
}

0 comments on commit 06d991d

Please sign in to comment.