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

[imp] avoid throwing an exception in HasOwner because makes ACL harder #20

Merged
merged 1 commit into from
Jul 3, 2018

Conversation

phproberto
Copy link
Owner

ACL checks perform a lot of ownership tests. There are some special cases where an owner column may not be present but throwing an error is not the best option.

Example

Creating an item but not assigning the owner column (so it doesn't have owner).

$article = new Article;
$article->bind(['title' => 'Hello World', 'catid' => 1]);

// This will throw an exception
if ($this->canCreate())
{
}

$article = new Article;
$article->bind(['title' => 'Hello World', 'catid' => 1, 'created_by' => 22]);

// This won't throw an exception
if ($this->canCreate())
{
}

@phproberto phproberto merged commit e2e029d into develop Jul 3, 2018
@phproberto phproberto deleted the has-owner branch July 3, 2018 14:13
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.

None yet

1 participant