Update permissions table seeder with new structure

This commit is contained in:
Toby Zerner 2015-05-18 12:31:38 +09:30
parent 6522ecffbc
commit 50ea261c47

View File

@ -17,28 +17,24 @@ class PermissionsTableSeeder extends Seeder {
$permissions = [ $permissions = [
// Guests can view the forum // Guests can view the forum
['group.2' , 'forum' , 'view'], [2, 'forum.view'],
['group.2' , 'forum' , 'register'],
// Members can create and reply to discussions + edit their own stuff // Members can create and reply to discussions + edit their own stuff
['group.3' , 'forum' , 'startDiscussion'], [3, 'forum.startDiscussion'],
['group.3' , 'discussion' , 'editOwn'], [3, 'discussion.reply'],
['group.3' , 'discussion' , 'reply'],
['group.3' , 'post' , 'editOwn'],
// Moderators can edit + delete stuff and suspend users // Moderators can edit + delete stuff and suspend users
['group.4' , 'discussion' , 'delete'], [4, 'discussion.delete'],
['group.4' , 'discussion' , 'edit'], [4, 'discussion.rename'],
['group.4' , 'post' , 'delete'], [4, 'post.delete'],
['group.4' , 'post' , 'edit'], [4, 'post.edit'],
['group.4' , 'user' , 'suspend'], [4, 'user.suspend'],
]; ];
foreach ($permissions as &$permission) { foreach ($permissions as &$permission) {
$permission = [ $permission = [
'grantee' => $permission[0], 'group_id' => $permission[0],
'entity' => $permission[1], 'permission' => $permission[1]
'permission' => $permission[2]
]; ];
} }
Permission::insert($permissions); Permission::insert($permissions);