-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
59 additions
and
8 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
migrations/20170710013345_add_edit_own_posts_permission.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?php | ||
|
||
use Phinx\Migration\AbstractMigration; | ||
|
||
class AddEditOwnPostsPermission extends AbstractMigration | ||
{ | ||
public function up() | ||
{ | ||
$this->execute("INSERT INTO permissions (name, description) | ||
VALUES ('Edit their own posts', 'Edit their own posts') | ||
"); | ||
|
||
$this->execute("INSERT INTO `roles_permissions` (`role`, `permission`) | ||
VALUES ('user', 'Edit their own posts') | ||
"); | ||
} | ||
|
||
public function down() | ||
{ | ||
$this->execute("DELETE FROM permissions WHERE name = 'Edit their own posts'"); | ||
|
||
$this->execute("DELETE FROM roles_permissions WHERE permission = 'Edit their own posts'"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters