Skip to content

Commit 8d8aa2a

Browse files
author
Mehmet Faruk Demirkoparan
committed
Merge remote-tracking branch 'origin/aauth-v2' into aauth-v2
# Conflicts: # src/AAuth.php
2 parents ba5ff0d + e69842f commit 8d8aa2a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/helpers.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,46 +4,47 @@
44
use AuroraWebSoftware\AAuth\Models\OrganizationNode;
55
use AuroraWebSoftware\AAuth\Models\Role;
66

7-
if (!function_exists('aauth')) {
7+
if (! function_exists('aauth')) {
88
function aauth(): AAuth
99
{
1010
return app('aauth');
1111
}
1212
}
1313

14-
if (!function_exists('aauth_can')) {
14+
if (! function_exists('aauth_can')) {
1515
function aauth_can(string $permission, mixed ...$arguments): bool
1616
{
1717
return app('aauth')->can($permission, ...$arguments);
1818
}
1919
}
2020

21-
if (!function_exists('aauth_has_role')) {
21+
if (! function_exists('aauth_has_role')) {
2222
function aauth_has_role(string $roleName): bool
2323
{
2424
return app('aauth')->currentRole()?->name === $roleName;
2525
}
2626
}
2727

28-
if (!function_exists('aauth_active_role')) {
28+
if (! function_exists('aauth_active_role')) {
2929
function aauth_active_role(): ?Role
3030
{
3131
return app('aauth')->currentRole();
3232
}
3333
}
3434

35-
if (!function_exists('aauth_active_organization')) {
35+
if (! function_exists('aauth_active_organization')) {
3636
function aauth_active_organization(): ?OrganizationNode
3737
{
3838
$nodeIds = app('aauth')->organizationNodeIds();
3939
if (empty($nodeIds)) {
4040
return null;
4141
}
42+
4243
return OrganizationNode::find($nodeIds[0]);
4344
}
4445
}
4546

46-
if (!function_exists('aauth_is_super_admin')) {
47+
if (! function_exists('aauth_is_super_admin')) {
4748
function aauth_is_super_admin(): bool
4849
{
4950
return app('aauth')->isSuperAdmin();

0 commit comments

Comments
 (0)