mirror of
https://gitlab.com/signalytic/client-external/streamline/streamline-emr.git
synced 2026-09-12 19:21:33 +00:00
Import latest app updates from streamline
An updated set of source files and initialization was provided by streamline to address issues observed during initial testing. These files have been updated in order to generate a new set of app images.
This commit is contained in:
Vendored
-14
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\Permission\Exceptions;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use InvalidArgumentException;
|
||||
|
||||
class GuardDoesNotMatch extends InvalidArgumentException
|
||||
{
|
||||
public static function create(string $givenGuard, Collection $expectedGuards)
|
||||
{
|
||||
return new static("The given role or permission should use guard `{$expectedGuards->implode(', ')}` instead of `{$givenGuard}`.");
|
||||
}
|
||||
}
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\Permission\Exceptions;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
class PermissionAlreadyExists extends InvalidArgumentException
|
||||
{
|
||||
public static function create(string $permissionName, string $guardName)
|
||||
{
|
||||
return new static("A `{$permissionName}` permission already exists for guard `{$guardName}`.");
|
||||
}
|
||||
}
|
||||
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\Permission\Exceptions;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
class PermissionDoesNotExist extends InvalidArgumentException
|
||||
{
|
||||
public static function create(string $permissionName, string $guardName = '')
|
||||
{
|
||||
return new static("There is no permission named `{$permissionName}` for guard `{$guardName}`.");
|
||||
}
|
||||
|
||||
public static function withId(int $permissionId, string $guardName = '')
|
||||
{
|
||||
return new static("There is no [permission] with id `{$permissionId}` for guard `{$guardName}`.");
|
||||
}
|
||||
}
|
||||
Vendored
-13
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\Permission\Exceptions;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
class RoleAlreadyExists extends InvalidArgumentException
|
||||
{
|
||||
public static function create(string $roleName, string $guardName)
|
||||
{
|
||||
return new static("A role `{$roleName}` already exists for guard `{$guardName}`.");
|
||||
}
|
||||
}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\Permission\Exceptions;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
class RoleDoesNotExist extends InvalidArgumentException
|
||||
{
|
||||
public static function named(string $roleName)
|
||||
{
|
||||
return new static("There is no role named `{$roleName}`.");
|
||||
}
|
||||
|
||||
public static function withId(int $roleId)
|
||||
{
|
||||
return new static("There is no role with id `{$roleId}`.");
|
||||
}
|
||||
}
|
||||
Vendored
-69
@@ -1,69 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\Permission\Exceptions;
|
||||
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
|
||||
class UnauthorizedException extends HttpException
|
||||
{
|
||||
private $requiredRoles = [];
|
||||
|
||||
private $requiredPermissions = [];
|
||||
|
||||
public static function forRoles(array $roles): self
|
||||
{
|
||||
$message = 'User does not have the right roles.';
|
||||
|
||||
if (config('permission.display_role_in_exception')) {
|
||||
$message .= ' Necessary roles are '.implode(', ', $roles);
|
||||
}
|
||||
|
||||
$exception = new static(403, $message, null, []);
|
||||
$exception->requiredRoles = $roles;
|
||||
|
||||
return $exception;
|
||||
}
|
||||
|
||||
public static function forPermissions(array $permissions): self
|
||||
{
|
||||
$message = 'User does not have the right permissions.';
|
||||
|
||||
if (config('permission.display_permission_in_exception')) {
|
||||
$message .= ' Necessary permissions are '.implode(', ', $permissions);
|
||||
}
|
||||
|
||||
$exception = new static(403, $message, null, []);
|
||||
$exception->requiredPermissions = $permissions;
|
||||
|
||||
return $exception;
|
||||
}
|
||||
|
||||
public static function forRolesOrPermissions(array $rolesOrPermissions): self
|
||||
{
|
||||
$message = 'User does not have any of the necessary access rights.';
|
||||
|
||||
if (config('permission.display_permission_in_exception') && config('permission.display_role_in_exception')) {
|
||||
$message .= ' Necessary roles or permissions are '.implode(', ', $rolesOrPermissions);
|
||||
}
|
||||
|
||||
$exception = new static(403, $message, null, []);
|
||||
$exception->requiredPermissions = $rolesOrPermissions;
|
||||
|
||||
return $exception;
|
||||
}
|
||||
|
||||
public static function notLoggedIn(): self
|
||||
{
|
||||
return new static(403, 'User is not logged in.', null, []);
|
||||
}
|
||||
|
||||
public function getRequiredRoles(): array
|
||||
{
|
||||
return $this->requiredRoles;
|
||||
}
|
||||
|
||||
public function getRequiredPermissions(): array
|
||||
{
|
||||
return $this->requiredPermissions;
|
||||
}
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\Permission\Exceptions;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
class WildcardPermissionInvalidArgument extends InvalidArgumentException
|
||||
{
|
||||
public static function create()
|
||||
{
|
||||
return new static('Wildcard permission must be string, permission id or permission instance');
|
||||
}
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\Permission\Exceptions;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
class WildcardPermissionNotImplementsContract extends InvalidArgumentException
|
||||
{
|
||||
public static function create()
|
||||
{
|
||||
return new static('Wildcard permission class must implements Spatie\Permission\Contracts\Wildcard contract');
|
||||
}
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Spatie\Permission\Exceptions;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
class WildcardPermissionNotProperlyFormatted extends InvalidArgumentException
|
||||
{
|
||||
public static function create(string $permission)
|
||||
{
|
||||
return new static("Wildcard permission `{$permission}` is not properly formatted.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user