Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: feature(river): Adds hook-based permissions for river item delete action #8942

Closed
wants to merge 1 commit into from

Conversation

mrclay
Copy link
Member

@mrclay mrclay commented Sep 16, 2015

Fixes #8936

* @return \ElggUser|false
* @access private
*/
public function resolveUser($guid = 0) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Better suggestions for naming this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make this more generic?
I think it would be useful to have something like resolve($guid = 0, $type = null, $subtype = null). We could then use elgg_entity_exists() beforehand, or elgg_instanceof() afterwards.

Copy link
Member Author

Choose a reason for hiding this comment

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

Strawman: move the functionality to get(), add $subtype (= null) and $ignore_condition (= false). For this use we'd set $type to "user" and $ignore_condition to true.

Copy link
Contributor

Choose a reason for hiding this comment

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

SGTM. I think it will be much cleaner.

…ents

This also deprecates elgg_delete_river().

Fixes Elgg#8936
@@ -1035,21 +1035,8 @@ public function canEdit($user_guid = 0) {
* @see elgg_set_ignore_access()
*/
public function canDelete($user_guid = 0) {
$user_guid = (int) $user_guid;
$user = _elgg_services()->entityTable->resolveUser($user_guid);
Copy link
Member Author

Choose a reason for hiding this comment

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

Waiting for #8944 to offer a standard API for this.

@mrclay
Copy link
Member Author

mrclay commented Jul 11, 2016

Replaced by #9964

@mrclay mrclay closed this Jul 11, 2016
@mrclay mrclay deleted the river_can_delete_8936 branch July 11, 2016 00:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants