Skip to content

Commit

Permalink
Merge branch 'master' into catch-exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
erik-epineer authored Jan 30, 2019
2 parents d303bb0 + 5633222 commit b06a686
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 13 deletions.
2 changes: 1 addition & 1 deletion resources/css/kontour.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 9 additions & 1 deletion resources/sass/_reset.scss
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,19 @@ img {
height: auto;
}

dl > * {
break-inside: avoid;
}

dl > div {
margin-top: 0;
padding-bottom: 1rem;
}

dt {
break-after: avoid;
}

dd {
break-inside: avoid;
break-before: avoid;
}
8 changes: 5 additions & 3 deletions resources/views/dashboard/laravelConfig.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
Laravel configuration
</header>
<dl class="columns-narrow">
@foreach(['app.name', 'app.url', 'app.env', 'app.debug', 'mail.from.address', 'mail.from.name', 'kontour.guard', 'session.cookie', 'session.lifetime', 'database.default', 'cache.default', 'filesystems.default'] as $configKey)
<dt><code>{{ $configKey }}</code></dt>
<dd>{{ config($configKey) }}</dd>
@foreach(['app.name', 'app.url', 'app.env', 'app.debug', 'mail.from.address', 'mail.from.name', 'auth.defaults.guard', 'kontour.guard', 'session.cookie', 'session.lifetime', 'database.default', 'cache.default', 'filesystems.default'] as $configKey)
<div>
<dt><code>{{ $configKey }}</code></dt>
<dd>{{ config($configKey) }}</dd>
</div>
@endforeach
</dl>
</section>
10 changes: 6 additions & 4 deletions src/Concerns/AuthorizesAdminRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ protected function authorizeAdminVisit(
string $linkDescription = null,
$abilityArguments = []
): AdminLink {
[$ability, $abilityArguments] = $this->parseAbilityAndArguments($ability, $abilityArguments);
$link = AdminLink::create($linkName, url()->full(), $linkDescription);

$result = $this->authorizeForUser($this->adminUser(), $ability, $abilityArguments);
if (!is_null($ability)) {
$result = $this->authorizeForUser($this->adminUser(), $ability, $abilityArguments);
$link->registerAbilityForAuthorization($ability, $abilityArguments);
}

return AdminLink::create($linkName, url()->full(), $linkDescription)
->registerAbilityForAuthorization($ability, $abilityArguments);
return $link;
}
}
4 changes: 2 additions & 2 deletions src/Concerns/AuthorizesWithAbility.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ trait AuthorizesWithAbility

/**
* Register a policy or gate to be used for the authorization
* @param string $ability name from a Gate/Policy
* @param string|null $ability name from a Gate/Policy, or null to unset
* @param array|mixed $arguments for the ability check, typically a model instance
* @return $this
*/
public function registerAbilityForAuthorization(string $ability, $arguments = []): AuthorizesWithAbilityContract
public function registerAbilityForAuthorization(?string $ability, $arguments = []): AuthorizesWithAbilityContract
{
$this->authorizesWithAbilityName = $ability;
$this->authorizesWithAbilityArguments = $arguments;
Expand Down
4 changes: 2 additions & 2 deletions src/Contracts/AuthorizesWithAbility.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ interface AuthorizesWithAbility extends Authorizes
{
/**
* Register a policy or gate to be used for the authorization
* @param string $ability name from a Gate/Policy
* @param string|null $ability name from a Gate/Policy, or null to unset
* @param array|mixed $arguments for the ability check, typically a model instance
* @return $this
*/
public function registerAbilityForAuthorization(string $ability, $arguments = []): AuthorizesWithAbility;
public function registerAbilityForAuthorization(?string $ability, $arguments = []): AuthorizesWithAbility;

/**
* Register a guard to be used for the authorization
Expand Down

0 comments on commit b06a686

Please sign in to comment.