Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAcl Resource rename #13639
Comments
niden
added this to To do
in 4.0 Release
via automation
Dec 7, 2018
niden
added
the
Breaks BC
label
Dec 7, 2018
niden
self-assigned this
Dec 7, 2018
niden
added this to the 4.0.0 milestone
Dec 7, 2018
This comment has been minimized.
This comment has been minimized.
+1, especially about rethinking |
niden
changed the title
"Resource" rename
Acl Resource rename
Dec 9, 2018
niden
moved this from To do
to In progress
in 4.0 Release
Dec 17, 2018
added a commit
to niden/cphalcon
that referenced
this issue
Dec 17, 2018
added a commit
to niden/cphalcon
that referenced
this issue
Dec 17, 2018
added a commit
to niden/cphalcon
that referenced
this issue
Dec 17, 2018
added a commit
to niden/cphalcon
that referenced
this issue
Dec 17, 2018
added a commit
to niden/cphalcon
that referenced
this issue
Dec 17, 2018
added a commit
that referenced
this issue
Dec 17, 2018
niden
moved this from In progress
to Done
in 4.0 Release
Dec 17, 2018
added a commit
to niden/cphalcon
that referenced
this issue
Dec 18, 2018
This comment has been minimized.
This comment has been minimized.
|
niden
closed this
Dec 21, 2018
This comment has been minimized.
This comment has been minimized.
I still maintain this is confusing if not unnecessary, or maybe I’m missing something? Why do we need two interfaces? Anything that needs to be passed to |
This comment has been minimized.
This comment has been minimized.
@scrnjakovic I see your point. Let me talk to the core team and see whether we can remove the aware interface and what use case serves. With 4.x coming up, now is the time to do this. |
This comment has been minimized.
This comment has been minimized.
For me it's simple @scrnjakovic just check ResourceInterface, it has methods like getDescription etc. ResourceAware and RoleAware where implemented so you can for example do something like: class Article extends Model implements ResourceAware
{
public function getResourceName()
{
return 'article';
}
} class User extends Model implements RoleAware
{
public function getRoleName()
{
return 'user';
}
} And then do: $acl = new Memory();
$acl->addResource('article', ['update']);
$acl->allow('user', 'article', ['update']);
$article = Article::findFirst();
$user = User::findFirst();
$canUpdate = $acl->isAllowed($user, $article, 'update'); // will return result So pretty much Maybe we can figure something else, if you have any idea feel free to write it. I just don't see a good way to solve this issue. Also i don't think that merging two interfaces that are for totally different things will solve anything. I guess we can possibly do it somehow by just renaming methods in RoleInterface and ResourceInterface. |
This comment has been minimized.
This comment has been minimized.
To attempt to clarify, based on what I'm reading above, Is that accurate? Because if so, they do serve very distinct purposes. Though I'd probably argue, at that point, that |
This comment has been minimized.
This comment has been minimized.
Exactly this @danhunsaker but it's more like RoleAware/ResourceAware is representation of these Roles/Resources. |
This comment has been minimized.
This comment has been minimized.
Sorry for not catching the |
niden commentedDec 7, 2018
•
edited
I suggest to rename
Resource
, because it's on soft reserved word of PHP.To rename:
Phalcon\Acl\Resource
(???)Phalcon\Acl\ResourceInterface
Phalcon\Acl\ResourceAware
(I doubt in the necessity of this class)Phalcon\Acl\Resource -> Phalcon\Acl\Subject
Phalcon\Acl\ResourceInterface -> Phalcon\Acl\SubjectInterface
Phalcon\Acl\ResourceAware -> Phalcon\Acl\SubjectAware
Phalcon\Acl\Role -> Phalcon\Acl\Operation
Phalcon\Acl\RoleInterface -> Phalcon\Acl\OperationInterface
Phalcon\Acl\RoleAware -> Phalcon\Acl\OperationAware