Skip to content

[WIP] Start converting hook_node_access to hook_entity_access for 8.x#38

Closed
damiankloip wants to merge 5 commits into
amitaibu:8.x-1.xfrom
damiankloip:entity-access
Closed

[WIP] Start converting hook_node_access to hook_entity_access for 8.x#38
damiankloip wants to merge 5 commits into
amitaibu:8.x-1.xfrom
damiankloip:entity-access

Conversation

@damiankloip

Copy link
Copy Markdown
Collaborator

Didn't get a chance to finish this atm, but pulled the thread that is hook_node_access > hook_entity_access :)

Comment thread og.module Outdated

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ping @RoySegall will your #35 PR help with these functions to get user roles?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tl;dr - Yes.

long - I think if we have api function for get the roles, for example, they need to be as a static method on the user role entity. Look me to more encapsulate.

@damiankloip damiankloip force-pushed the entity-access branch 2 times, most recently from 3dd3042 to c47187c Compare November 24, 2015 11:19
Comment thread src/OgAccess.php

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main part I need to convert now to move on with this PR. I also started on #40 but that also needs some of this access stuff... :/

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would take it in several steps. We can start converting the access and get the OG roles/ OG permissions in a second step - otherwise, it's going to be a big one. agree?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, definitely agree! We need to at least get some chunks in so we can then spin up some smaller PRs around that. Should we comment this out for now maybe with a @todo ?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A todo and an Issue would be great

@amitaibu

Copy link
Copy Markdown
Owner

You are a brave man! This is a big one, and it will need also the tests ported. The hardest part would be to try and keep this PR small without tons of scope creeps :)

@damiankloip

Copy link
Copy Markdown
Collaborator Author

Ha :) trouble is there are a bunch of other smaller parts that this needs
too... that's why we might as well merge that PR for the test classes too.
On 24 Nov 2015 21:00, "Amitai Burstein" notifications@github.com wrote:

You are a brave man! This is a big one, and it will need also the tests
ported. The hardest part would be to try and keep this PR small without
tons of scope creeps :)


Reply to this email directly or view it on GitHub
#38 (comment).

@amitaibu

Copy link
Copy Markdown
Owner

@damiankloip mind if I help with this PR? I'd like to start porting some tests

Comment thread src/OgAccess.php

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want to move this to own plugin instead of the alter? (Damien, do you have a rule of thumb for when alter VS plugins?)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good as an alter hook still. It is not something you would want multiple instances of etc.. Plugins get a bit weird when used outside their usual patterns. Just look at the element plugins in core.... :)

I will convert that to use the module handler directly though.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should consider using event more in Og instead too. Maybe we can talk about that next week.

@damiankloip

Copy link
Copy Markdown
Collaborator Author

@amitaibu no, you can sure help with this. If you are working on tests that should be nice and separate to my work here. Or did you want to take this over or something?

@damiankloip

Copy link
Copy Markdown
Collaborator Author

Or we can get this to a good state for you to take over in a new PR? Just trying to think what's easiest for both of us here :) You can choose.

If you wanted to branch from this and take this over, that's cool. If you did I would just focus on #40 more.

@amitaibu

Copy link
Copy Markdown
Owner

If you wanted to branch from this and take this over, that's cool. If you did I would just focus on #40 more.

Sounds good, I'll assign to myself. I'll try to tackle on Sunday.

@amitaibu amitaibu self-assigned this Nov 27, 2015
@pfrenssen

Copy link
Copy Markdown
Collaborator

This looks like the test for it: ec-europa@a8b1201 - it mentions it is testing og_user_access_entity() but that just seems to have been a convenient wrapper to check node access.

You can merge this commit in this branch. Let me know if you've done so then I can remove the branch in my fork, to avoid duplicate work to be done.

@amitaibu

Copy link
Copy Markdown
Owner

Nice, handy link :)

@pfrenssen

Copy link
Copy Markdown
Collaborator

Github magic :D

@amitaibu

Copy link
Copy Markdown
Owner

Closing in favor of #51

@amitaibu amitaibu closed this Nov 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants