Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
Doorcode
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
5
Issues
5
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Guardians of the Kretschmar Elock System
Doorcode
Commits
e7af8026
Commit
e7af8026
authored
Apr 06, 2020
by
Jacob Priddy
👌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Protect door routes
parent
b3fa4008
Pipeline
#5509
passed with stages
in 2 minutes and 6 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
0 deletions
+13
-0
src/web/backend/app/Http/Controllers/DoorsController.php
src/web/backend/app/Http/Controllers/DoorsController.php
+13
-0
No files found.
src/web/backend/app/Http/Controllers/DoorsController.php
View file @
e7af8026
...
...
@@ -57,10 +57,14 @@ class DoorsController extends ApiController
* @param \Source\UseCases\Doors\CreateDoor\CreateDoorUseCase $createDoor
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Validation\ValidationException
* @throws \Source\Exceptions\AuthorizationException
* @throws \Source\Exceptions\EntityExistsException
* @throws \Source\Exceptions\EntityNotFoundException
*/
public
function
store
(
CreateDoorUseCase
$createDoor
):
JsonResponse
{
$this
->
authorizer
->
protectAll
([
Permissions
::
MANAGE_DOORS
]);
$this
->
validate
(
$this
->
request
,
[
'location'
=>
'required|string|max:255'
,
'name'
=>
'required|string|max:255'
,
...
...
@@ -81,9 +85,12 @@ class DoorsController extends ApiController
* @return \Illuminate\Http\JsonResponse
* @throws \Illuminate\Validation\ValidationException
* @throws \Source\Exceptions\EntityNotFoundException
* @throws \Source\Exceptions\AuthorizationException
*/
public
function
update
(
UpdateDoorUseCase
$updateDoor
,
string
$doorId
):
JsonResponse
{
$this
->
authorizer
->
protectAll
([
Permissions
::
MANAGE_DOORS
]);
$this
->
validate
(
$this
->
request
,
[
'location'
=>
'string|max:255'
,
'name'
=>
'string|max:255'
,
...
...
@@ -102,9 +109,12 @@ class DoorsController extends ApiController
* @param string $doorId
* @return \Illuminate\Http\JsonResponse
* @throws \Source\Exceptions\EntityNotFoundException
* @throws \Source\Exceptions\AuthorizationException
*/
public
function
regenerateToken
(
GenerateDoorTokenUseCase
$tokenGenerator
,
string
$doorId
):
JsonResponse
{
$this
->
authorizer
->
protectAll
([
Permissions
::
MANAGE_DOORS
]);
$presenter
=
new
CreateDoorAPIPresenter
();
$tokenGenerator
->
generate
(
$doorId
,
config
(
'app.key'
),
$presenter
);
...
...
@@ -117,9 +127,12 @@ class DoorsController extends ApiController
* @param string $doorId
* @return \Illuminate\Http\JsonResponse
* @throws \Source\Exceptions\EntityNotFoundException
* @throws \Source\Exceptions\AuthorizationException
*/
public
function
delete
(
DeleteDoorUseCase
$doorDelyeeter
,
string
$doorId
):
JsonResponse
{
$this
->
authorizer
->
protectAll
([
Permissions
::
MANAGE_DOORS
]);
$presenter
=
new
DeleteDoorAPIPresenter
();
$doorDelyeeter
->
delete
(
$doorId
,
$presenter
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment