Skip to content

Commit

Permalink
Modifed method accessCheck for a more logical order of arguments.
Browse files Browse the repository at this point in the history
  • Loading branch information
vasiliishvakin committed Jun 16, 2017
1 parent e283051 commit da44584
Show file tree
Hide file tree
Showing 9 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
},
"require": {
"akademiano/user": "^1.0.0-beta.1",
"akademiano/user": "^1.0.0-beta.2",
"akademiano/utils": "^1.0.0-beta.6",
"akademiano/entity": "^1.0.0-beta.1",
"akademiano/config": "^1.0.0-beta.9"
Expand Down
2 changes: 1 addition & 1 deletion src/AccessCheckIncludeInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ interface AccessCheckIncludeInterface
{
public function setAclManager(AccessCheckInterface $aclManager);

public function accessCheck($resource = null, GroupInterface $group = null, UserInterface $user = null, UserInterface $owner = null);
public function accessCheck($resource = null, UserInterface $owner = null, GroupInterface $group = null, UserInterface $user = null);
}
4 changes: 2 additions & 2 deletions src/AccessCheckIncludeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ public function setAclManager(AccessCheckInterface $aclManager)
$this->aclManager = $aclManager;
}

public function accessCheck($resource = null, GroupInterface $group = null, UserInterface $user = null, UserInterface $owner = null)
public function accessCheck($resource = null, UserInterface $owner = null, GroupInterface $group = null, UserInterface $user = null)
{
return $this->getAclManager()->accessCheck($resource, $group, $user, $owner);
return $this->getAclManager()->accessCheck($resource, $owner, $group, $user);
}
}
2 changes: 1 addition & 1 deletion src/AccessCheckInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@

interface AccessCheckInterface
{
public function accessCheck($resource, GroupInterface $group, UserInterface $user = null, UserInterface $owner = null);
public function accessCheck($resource, UserInterface $owner = null, GroupInterface $group, UserInterface $user = null);
}
4 changes: 2 additions & 2 deletions src/AclManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function getResource()
return $resource;
}

public function accessCheck($resource = null, GroupInterface $group, UserInterface $user = null, UserInterface $owner = null)
public function accessCheck($resource = null, UserInterface $owner = null, GroupInterface $group, UserInterface $user = null)
{
if (null === $resource) {
$resource = $this->getResource();
Expand All @@ -87,6 +87,6 @@ public function accessCheck($resource = null, GroupInterface $group, UserInterfa
$user = $this->getCustodian()->getCurrentUser();
}
$group = $user->getGroup();
return $this->getAclAdapter()->accessCheck($resource, $group, $user, $owner);
return $this->getAclAdapter()->accessCheck($resource, $owner, $group, $user);
}
}
2 changes: 1 addition & 1 deletion src/Adapter/AllowAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class AllowAdapter implements AdapterInterface
{
public function accessCheck($resource, GroupInterface $group, UserInterface $user = null, UserInterface $owner = null)
public function accessCheck($resource, UserInterface $owner = null, GroupInterface $group, UserInterface $user = null)
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/DenyAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

class DenyAdapter implements AdapterInterface
{
public function accessCheck($resource, GroupInterface $group, UserInterface $user = null, UserInterface $owner = null)
public function accessCheck($resource, UserInterface $owner = null, GroupInterface $group, UserInterface $user = null)
{
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/RegisteredAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function getPatches()
return $this->patches;
}

public function accessCheck($resource, GroupInterface $group, UserInterface $user = null, UserInterface $owner = null)
public function accessCheck($resource, UserInterface $owner = null, GroupInterface $group, UserInterface $user = null)
{
$resource = $this->prepareResource($resource);
$char = mb_strcut($resource, 0, 1);
Expand Down
2 changes: 1 addition & 1 deletion src/Adapter/XAclAdapterInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function prepareResource($resource)
return $resource;
}

public function accessCheck($resource, GroupInterface $group, UserInterface $user = null, UserInterface $owner = null)
public function accessCheck($resource, UserInterface $owner = null, GroupInterface $group, UserInterface $user = null)
{
$resource = $this->prepareResource($resource);
$params = [
Expand Down

0 comments on commit da44584

Please sign in to comment.