Skip to content

Commit

Permalink
Add the HasOwnerInterface.
Browse files Browse the repository at this point in the history
  • Loading branch information
nilov committed Feb 5, 2016
1 parent 3db0527 commit 87d22d9
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Security/Authorization/Voter/OwnerVoter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Glavweb\CoreBundle\Security\Authorization\Voter;

use Sonata\UserBundle\Model\HasOwnerInterface;
use Glavweb\CoreBundle\Security\HasOwnerInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
use Symfony\Component\Security\Core\User\UserInterface;
Expand Down Expand Up @@ -40,7 +40,7 @@ public function supportsAttribute($attribute)
public function supportsClass($class)
{
$reflectionClass = new \ReflectionClass($class);
return $reflectionClass->implementsInterface('Sonata\UserBundle\Model\HasOwnerInterface');
return $reflectionClass->implementsInterface('Glavweb\CoreBundle\Security\HasOwnerInterface');
}

/**
Expand Down
17 changes: 17 additions & 0 deletions Security/HasOwnerInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Glavweb\CoreBundle\Security;

/**
* Interface HasOwnerInterface
* @package Glavweb\CoreBundle\Security
*/
interface HasOwnerInterface
{
/**
* Return array of owner fields
*
* @return array
*/
public static function getOwnerFields();
}

0 comments on commit 87d22d9

Please sign in to comment.