feat: adding roles and permissions relations to my schema (#80)

This commit is contained in:
paranarimasu
2023-03-13 17:13:55 -05:00
committed by Maniload
parent 405324a0ed
commit 0e878fba06
7 changed files with 98 additions and 8 deletions
+16
View File
@@ -53,6 +53,8 @@ export default {
items: [
{ text: 'Index', link: '/auth/' },
{ text: 'Me', link: '/auth/user/me/' },
{ text: 'Permission', link: '/auth/permission/' },
{ text: 'Role', link: '/auth/role/' },
{ text: 'User', link: '/auth/user/' }
],
},
@@ -160,6 +162,20 @@ export default {
{ text: 'Playlists', link: '/auth/user/me/playlist/' }
]
},
{
text: 'Permission',
collapsed: true,
items: [
{ text: 'Resource', link: '/auth/permission/' }
]
},
{
text: 'Role',
collapsed: true,
items: [
{ text: 'Resource', link: '/auth/role/' }
]
},
{
text: 'User',
collapsed: true,
+12
View File
@@ -10,6 +10,18 @@ Auth API resources pertain to the authorization of actions on the site.
## Resources
**[Me](/auth/user/me/)**
The "Me" namespace is a collection of endpoints that pertain to the currently authenticated user.
**[Permission](/auth/permission/)**
A permission API resource represents an assignable label for users and roles that authorizes a particular action in AnimeThemes.
**[Role](/auth/role/)**
A role API resource represents an assignable label for users that provides a configured group of permissions.
**[User](/auth/user/)**
A user API resource represents an AnimeThemes account.
+19
View File
@@ -0,0 +1,19 @@
---
title: Permission
---
# Permission
---
A permission API resource represents an assignable label for users and roles that authorizes a particular action in AnimeThemes.
## Fields
| Name | Type | Nullable | Default | Description |
| :--------: | :-----: | :------: | :-----: | :------------------------------------------- |
| id | Integer | No | Yes | The primary key of the resource |
| name | String | No | Yes | The label of the resource |
| guard_name | String | No | Yes | The authentication guard of the resource |
| created_at | Date | No | No | The date that the resource was created |
| updated_at | Date | No | No | The date that the resource was last modified |
+20
View File
@@ -0,0 +1,20 @@
---
title: Role
---
# Role
---
A role API resource represents an assignable label for users that provides a configured group of permissions.
## Fields
| Name | Type | Nullable | Default | Description |
| :--------: | :-----: | :------: | :-----: | :-------------------------------------------- |
| id | Integer | No | Yes | The primary key of the resource |
| name | String | No | Yes | The label of the resource |
| guard_name | String | No | Yes | The authentication guard of the resource |
| default | Boolean | No | Yes | Is the role assigned on account verification? |
| created_at | Date | No | No | The date that the resource was created |
| updated_at | Date | No | No | The date that the resource was last modified |
+3 -7
View File
@@ -10,13 +10,9 @@ A user API resource represents an AnimeThemes account.
## Fields
| Name | Type | Nullable | Default | Description |
| :--------: | :-----: | :------: | :-----: | :------------------------------------------- |
| id | Integer | No | Yes | The primary key of the resource |
| name | String | No | Yes | The username of the resource |
| created_at | Date | No | No | The date that the resource was created |
| updated_at | Date | No | No | The date that the resource was last modified |
| deleted_at | Date | Yes | No | The date that the resource was deleted |
| Name | Type | Nullable | Default | Description |
| :--------: | :-----: | :------: | :-----: | :--------------------------- |
| name | String | No | Yes | The username of the resource |
## Allowed Include Paths
+19
View File
@@ -8,6 +8,25 @@ title: Me
The "Me" namespace is a collection of endpoints that pertain to the currently authenticated user.
## Fields
| Name | Type | Nullable | Default | Description |
| :---------------------: | :-----: | :------: | :-----: | :-------------------------------------------------- |
| id | Integer | No | Yes | The primary key of the resource |
| name | String | No | Yes | The username of the resource |
| email | String | No | Yes | The email address of the resource |
| email_verified_at | Date | Yes | Yes | The date that the user verified their email address |
| two_factor_confirmed_at | Date | Yes | Yes | The date that the user confirmed 2FA |
| created_at | Date | No | No | The date that the resource was created |
| updated_at | Date | No | No | The date that the resource was last modified |
| deleted_at | Date | Yes | No | The date that the resource was deleted |
## Allowed Include Paths
* permissions
* playlists
* roles
## Endpoints
**[My Show](/auth/user/me/show/)**
+9 -1
View File
@@ -18,7 +18,12 @@ None
## Parameters
None
| Name | Required | Description |
| :-----: | :------: | :------------------------------------------------------ |
| fields | No | Sparse fieldsets for resource types |
| filter | No | Filters to constrain the inclusion of related resources |
| include | No | Inclusion of related resources |
| sort | No | Sort related resources |
## Response
@@ -27,6 +32,9 @@ None
user: {
id: id,
name: "name",
email: "email",
email_verified_at: "email_verified_at",
two_factor_confirmed_at: "two_factor_confirmed_at",
created_at: "created_at",
updated_at: "updated_at",
deleted_at: "deleted_at"