blue-twilight/database/seeds/PermissionsSeeder.php

87 lines
2.9 KiB
PHP
Raw Normal View History

<?php
use Illuminate\Database\Seeder;
class PermissionsSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
// album:list = controls if the album is visible in listings
DatabaseSeeder::createOrUpdate('permissions', [
'section' => 'album',
'description' => 'list',
'is_default' => true,
'sort_order' => 0
]);
// album:view = controls if the album can be viewed
DatabaseSeeder::createOrUpdate('permissions', [
'section' => 'album',
'description' => 'view',
'is_default' => true,
'sort_order' => 20
]);
// album:edit = controls if the album can be edited in the admin panel
DatabaseSeeder::createOrUpdate('permissions', [
'section' => 'album',
'description' => 'edit',
'is_default' => true,
'sort_order' => 10
]);
// album:delete = controls if the album can be deleted from the admin panel
DatabaseSeeder::createOrUpdate('permissions', [
'section' => 'album',
'description' => 'delete',
'is_default' => true,
'sort_order' => 20
]);
// album:upload-photos = controls if photos can be uploaded into the album
DatabaseSeeder::createOrUpdate('permissions', [
'section' => 'album',
'description' => 'upload-photos',
'is_default' => true,
'sort_order' => 30
]);
// album:edit-own-photos = controls if existing photos, owned by the current user, in the album can be edited
DatabaseSeeder::createOrUpdate('permissions', [
'section' => 'album',
'description' => 'edit-own-photos',
'is_default' => true,
'sort_order' => 40
]);
// album:edit-other-photos = controls if existing photos, owned by other users, in the album can be edited
DatabaseSeeder::createOrUpdate('permissions', [
'section' => 'album',
'description' => 'edit-other-photos',
'is_default' => true,
'sort_order' => 50
]);
// album:delete-own-photos = controls if existing photos, owned by the current user, in the album can be deleted
DatabaseSeeder::createOrUpdate('permissions', [
'section' => 'album',
'description' => 'delete-own-photos',
'is_default' => true,
'sort_order' => 60
]);
// album:delete-other-photos = controls if existing photos, owned by other users, in the album can be deleted
DatabaseSeeder::createOrUpdate('permissions', [
'section' => 'album',
'description' => 'delete-other-photos',
'is_default' => true,
'sort_order' => 70
]);
}
}