0% found this document useful (0 votes)
90 views20 pages

15 Julio Commit

This commit removes role and permission management and authorization/authentication requirements. It updates controller files and models to remove role checks and adds validation rules to the password reset controller. Models for Client, ClientType and Plan are added. The default string length is set to 191. Blade directives are updated to use the Bouncer authorization library instead of role checks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views20 pages

15 Julio Commit

This commit removes role and permission management and authorization/authentication requirements. It updates controller files and models to remove role checks and adds validation rules to the password reset controller. Models for Client, ClientType and Plan are added. The default string length is set to 191. Blade directives are updated to use the Bouncer authorization library instead of role checks.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

Please ensure your account's recovery settings are up to date.

Commit e40c183c authored 2 weeks ago by Guillermo Agudelo

Termina administrar roles y permisos y requerimientos de Autorizacion y


Autenticacion

parent 1d4c5b67 master

No related merge requests found

Showing 41 changed files  with 550 additions and 332 deletions

  app/Http/Controllers/Admin/RoleController.php
... ... @@ -4,10 +4,12 @@ namespace App\Http\Controllers\Admin;
4 4
5 5 use App\Http\Controllers\Controller;
6 6 use Illuminate\Http\Request;
7 + use Silber\Bouncer\Database\Ability;
7 8 use Silber\Bouncer\Database\Role;
8 9
9 10 class RoleController extends Controller
10 11 {
12 +
11 13 public function index()
12 14 {
13 15 $roles = Role::all();
... ... @@ -16,7 +18,8 @@ class RoleController extends Controller
16 18
17 19 public function show(Request $request, Role $role)
18 20 {
19 - return view('admin.roles.show', compact('role'));
21 + $abilities = Ability::orderBy('name')->get();
22 + return view('admin.roles.show', compact('role', 'abilities'));
20 23 }
21 24
22 25 public function store(Request $request)
... ... @@ -55,4 +58,15 @@ class RoleController extends Controller
55 58
56 59 return redirect()->route('admin.roles.index');
57 60 }
61 +
62 + public function syncAbilities(Request $request, Role $role)
63 + {
64 + $request->validate(['abilities' => 'required']);
65 +
66 + \Bouncer::sync($role)->abilities($request->get('abilities'));
67 +
68 + feedback('success', 'Se guardaron las habilidades');
69 +
70 + return redirect()->route('admin.roles.show', $role);
71 + }
58 72 }

  app/Http/Controllers/Auth/ResetPasswordController.php
... ... @@ -27,4 +27,18 @@ class ResetPasswordController extends Controller
27 27 * @var string
28 28 */
29 29 protected $redirectTo = RouteServiceProvider::HOME;
30 +
31 + /**
32 + * Get the password reset validation rules.
33 + *
34 + * @return array
35 + */

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 1/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

36 + protected function rules()


37 + {
38 + return [
39 + 'token' => 'required',
40 + 'email' => 'required|email',
41 + 'password' => 'required|confirmed|min:4',
42 + ];
43 + }
30 44 }

  app/Models/Client.php 0 → 100644
1 + <?php
2 +
3 + namespace App\Models;
4 +
5 + use Illuminate\Database\Eloquent\Model;
6 +
7 + class Client extends Model
8 +{
9 + protected $guarded = ['active'];
10 +
11 + public function plan()
12 + {
13 + return $this->belongsTo(Plan::class);
14 + }
15 +}

  app/Models/ClientType.php 0 → 100644
1 + <?php
2 +
3 + namespace App\Models;
4 +
5 + use Illuminate\Database\Eloquent\Model;
6 +
7 + class ClientType extends Model
8 +{
9 + protected $guarded = [];
10 +}

  app/Models/Plan.php 0 → 100644
1 + <?php
2 +
3 + namespace App\Models;
4 +
5 + use Illuminate\Database\Eloquent\Model;
6 +
7 + class Plan extends Model
8 +{
9 + protected $guarded = ['active'];
10 +}

  app/Providers/AppServiceProvider.php
... ... @@ -23,6 +23,6 @@ class AppServiceProvider extends ServiceProvider
23 23 */
24 24 public function boot()
25 25 {
26 - //
26 + \Schema::defaultStringLength(191);
27 27 }
28 28 }

  app/Providers/BladeServiceProvider.php

... ... @@ -28,33 +28,19 @@ class BladeServiceProvider extends ServiceProvider


28 28 {
29 29
30 30 Blade::if('superadmin', function() {
31 - return true;
32 - return \Auth::user()->role == Roles::SUPERADMIN;
31 + return \Auth::user()->isA(Roles::SUPERADMIN['name']);
33 32 });
34 33

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 2/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

35 34 Blade::if('admin', function() {
36 - return true;
37 - return \Auth::user()->role == Roles::ADMIN;
35 + return \Auth::user()->isA(Roles::ADMIN['name']);
38 36 });
39 37
40 - Blade::if('docente', function() {
41 - return true;
42 - return \Auth::user()->role == Roles::DOCENTE;
38 + Blade::if('user', function() {
39 + return \Auth::user()->isA(Roles::USER['name']);
43 40 });
44 41
45 - Blade::if('egt_admin', function() {
46 - return true;
47 - return \Auth::user()->role >= Roles::ADMIN;
48 - });
49 -
50 - Blade::if('elt_admin', function() {
51 - return true;
52 - return \Auth::user()->role <= Roles::ADMIN;
53 - });
54 -
55 - Blade::if('elt_docente', function() {
56 - return true;
57 - return \Auth::user()->role <= Roles::DOCENTE;
42 + Blade::if('adminplus', function() {
43 + return \Auth::user()->isA(Roles::ADMIN['name']) || \Auth::user()-
>isA(Roles::SUPERADMIN['name']);
58 44 });
59 45
60 46 }
... ...

  app/Support/Globals.php

... ... @@ -2,19 +2,64 @@


2 2
3 3 abstract class Roles
4 4 {
5 - const SUPERADMIN = '5SUPERADMIN';
6 - const ADMIN = '4ADMIN';
7 - const USUARIO = '3USUARIO';
5 + const SUPERADMIN = [
6 + 'name' => 'SUPERADMIN',
7 + 'title' => 'Superadministrador'
8 + ];
9 + const ADMIN = [
10 + 'name' => 'ADMIN',
11 + 'title' => 'Administrador'
12 + ];
13 + const USER = [
14 + 'name' => 'USER',
15 + 'title' => 'Usuario'
16 + ];
17 +
18 + public static function getConstants() {
19 + $oClass = new ReflectionClass(__CLASS__);
20 + return $oClass->getConstants();
21 + }
8 22 }
9 23
10 24 abstract class Abilities
11 25 {
12 - const ADMIN_INSTITUTION = 'ADMIN_INSTITUTION';
13 - const ADMIN_FAMILY_ACCOUNT = 'ADMIN_FAMILY_ACCOUNT';
14 - const DO_TEST = 'DO_TEST';
26 + const MANAGE_INSTITUTIONS = [
27 + 'name' => 'MANAGE_INSTITUTIONS',
28 + 'title' => 'Administrar Instituciones'
29 + ];
30 +
31 + const MANAGE_PERSONAL_ACCOUNTS = [
32 + 'name' => 'MANAGE_PERSONAL_ACCOUNTS',
33 + 'title' => 'Administrar Cuentas Personales o Familiares'

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 3/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

34 + ];
35 +
36 + const MANAGE_ROLES = [
37 + 'name' => 'MANAGE_ROLES',
38 + 'title' => 'Administrar Roles y Permisos'
39 + ];
40 +
41 + const DO_TESTS = [
42 + 'name' => 'DO_TESTS',
43 + 'title' => 'Realizar Pruebas'
44 + ];
45 +
46 + public static function getConstants() {
47 + $oClass = new ReflectionClass(__CLASS__);
48 + return $oClass->getConstants();
49 + }
15 50 }
16 51
17 52
53 + if (!function_exists('ability')) {
54 + function ability($name)
55 + {
56 + $abilities = Abilities::getConstants();
57 + $ability = collect($abilities)->first(fn($a) => $a['name'] == $name);
58 + if (!$ability) throw new \InvalidArgumentException("Ability '{$name}' doesn't exists.");
59 + return $ability['name'];
60 + }
61 +}
62 +
18 63 if (!function_exists('feedback')) {
19 64 function feedback($type, $message)
20 65 {
... ...

  app/User.php
... ... @@ -2,6 +2,7 @@
2 2
3 3 namespace App;
4 4
5 + use App\Models\Client;
5 6 use App\Models\Support\AccessLog;
6 7 use Illuminate\Contracts\Auth\MustVerifyEmail;
7 8 use Illuminate\Foundation\Auth\User as Authenticatable;
... ... @@ -45,4 +46,9 @@ class User extends Authenticatable
45 46 {
46 47 return $this->hasMany(AccessLog::class);
47 48 }
49 +
50 + public function client()
51 + {
52 + return $this->belongsTo(Client::class);
53 + }
48 54 }

  database/factories/UserFactory.php

... ... @@ -2,6 +2,7 @@


2 2
3 3 /** @var \Illuminate\Database\Eloquent\Factory $factory */
4 4
5 + use App\Models\Client;
5 6 use App\User;
6 7 use Faker\Generator as Faker;
7 8 use Illuminate\Support\Str;
... ... @@ -23,6 +24,7 @@ $factory->define(User::class, function (Faker $faker) {
23 24 'email' => $faker->unique()->safeEmail,
24 25 'email_verified_at' => now(),
25 26 'password' => '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi', // password
27 + 'client_id' => Client::all()->ramdom()->id,
26 28 'remember_token' => Str::random(10),
27 29 ];
28 30 });

  database/migrations/2020_07_13_083635_create_plans_table.php 0 → 100644

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 4/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

1 + <?php
2 +
3 + use App\Models\Plan;
4 + use Illuminate\Database\Migrations\Migration;
5 + use Illuminate\Database\Schema\Blueprint;
6 + use Illuminate\Support\Facades\Schema;
7 +
8 + class CreatePlansTable extends Migration
9 +{
10 + /**
11 + * Run the migrations.
12 + *
13 + * @return void
14 + */
15 + public function up()
16 + {
17 + Schema::create('plans', function (Blueprint $table) {
18 + $table->id();
19 + $table->string('name');
20 + $table->string('description');
21 + $table->boolean('active')->default(true);
22 + $table->timestamps();
23 + });
24 +
25 + Plan::create([
26 + 'name' => 'merani',
27 + 'description' => 'Plan Fundación Merani, Exclusivo para superadmins'
28 + ]);
29 + }
30 +
31 + /**
32 + * Reverse the migrations.
33 + *
34 + * @return void
35 + */
36 + public function down()
37 + {
38 + Schema::dropIfExists('plans');
39 + }
40 +}

  database/migrations/2020_07_13_083700_create_client_types_table.php 0 → 100644
1 + <?php
2 +
3 + use App\Models\ClientType;
4 + use Illuminate\Database\Migrations\Migration;
5 + use Illuminate\Database\Schema\Blueprint;
6 + use Illuminate\Support\Facades\Schema;
7 +
8 + class CreateClientTypesTable extends Migration
9 +{
10 + /**
11 + * Run the migrations.
12 + *
13 + * @return void
14 + */
15 + public function up()
16 + {
17 + Schema::create('client_types', function (Blueprint $table) {
18 + $table->id();
19 + $table->string('name');
20 + $table->string('description');
21 + $table->timestamps();
22 + });
23 +
24 + ClientType::create([
25 + 'name' => 'institution',
26 + 'description' => 'Institución Educativa'
27 + ]);
28 +
29 + ClientType::create([
30 + 'name' => 'personal',
31 + 'description' => 'Cuenta personal o familiar'
32 + ]);

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 5/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

33 + }
34 +
35 + /**
36 + * Reverse the migrations.
37 + *
38 + * @return void
39 + */
40 + public function down()
41 + {
42 + Schema::dropIfExists('client_types');
43 + }
44 +}

  database/migrations/2020_07_13_083743_create_clients_table.php 0 → 100644

1 + <?php
2 +
3 + use App\Models\Client;
4 + use Illuminate\Database\Migrations\Migration;
5 + use Illuminate\Database\Schema\Blueprint;
6 + use Illuminate\Support\Facades\Schema;
7 +
8 + class CreateClientsTable extends Migration
9 +{
10 + /**
11 + * Run the migrations.
12 + *
13 + * @return void
14 + */
15 + public function up()
16 + {
17 + Schema::create('clients', function (Blueprint $table) {
18 + $table->id();
19 + $table->string('name');
20 + $table->string('email');
21 + $table->string('phone')->nullable();
22 + $table->string('address')->nullable();
23 + $table->string('city')->nullable();
24 + $table->string('country_code')->default('CO');
25 + $table->string('image')->default(asset('images/school.jpg'));
26 + $table->foreignId('client_type_id');
27 + $table->foreignId('plan_id');
28 + $table->boolean('active')->default(true);
29 + $table->timestamps();
30 + });
31 +
32 + Client::create([
33 + 'name' => 'Fundación Alberto Merani',
34 + 'email' => 'gerencia@albertomerani.org',
35 + 'phone' => '+57(1)1111111',
36 + 'address' => 'Calle 1 Carrera 1 # 1',
37 + 'city' => 'Bogotá D.C.',
38 + 'country_code' => 'CO',
39 + 'client_type_id' => 1,
40 + 'plan_id' => 1,
41 + ]);
42 + }
43 +
44 + /**
45 + * Reverse the migrations.
46 + *
47 + * @return void
48 + */
49 + public function down()
50 + {
51 + Schema::dropIfExists('clients');
52 + }
53 +}

  database/migrations/2014_10_12_000000_create_users_table.php → database/migrations/2020_07_13_084000_create_user…
... ... @@ -19,6 +19,7 @@ class CreateUsersTable extends Migration
19 19 $table->string('email')->unique();
20 20 $table->timestamp('email_verified_at')->nullable();
21 21 $table->string('password');

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 6/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

22 + $table->foreignId('client_id');
22 23 $table->rememberToken();
23 24 $table->timestamps();
24 25 });
... ... @@ -27,6 +28,7 @@ class CreateUsersTable extends Migration
27 28 'name' => 'Super Administrador',
28 29 'email' => 'superadmin@merani.com',
29 30 'password' => Hash::make('secret'),
31 + 'client_id' => 1,
30 32 'created_at' => now(),
31 33 'updated_at' => now()
32 34 ]);
... ...

  database/migrations/2020_07_13_094639_create_bouncer_tables.php
... ... @@ -80,40 +80,27 @@ class CreateBouncerTables extends Migration
80 80
81 81
82 82 // Asignación de roles y permisos iniciales
83 - $superadmin = Bouncer::role()->firstOrCreate([
84 - 'name' => \Roles::SUPERADMIN,
85 - 'title' => 'Superadministrador del Sistema',
86 - ]);
87 -
88 - $admin = Bouncer::role()->firstOrCreate([
89 - 'name' => \Roles::ADMIN,
90 - 'title' => 'Administrador de Institución Educativa o de Cuenta Familiar',
91 - ]);
92 -
93 - $user = Bouncer::role()->firstOrCreate([
94 - 'name' => \Roles::USUARIO,
95 - 'title' => 'Usuario Docente, Familiar o Estudiante',
96 - ]);
97 -
98 - $adminInstitution = Bouncer::ability()->firstOrCreate([
99 - 'name' => \Abilities::ADMIN_INSTITUTION,
100 - 'title' => 'Administrar Institución',
101 - ]);
102 -
103 - $adminFamilyAccount = Bouncer::ability()->firstOrCreate([
104 - 'name' => \Abilities::ADMIN_FAMILY_ACCOUNT,
105 - 'title' => 'Administrar Cuentas Familiares',
106 - ]);
107 -
108 - $doTest = Bouncer::ability()->firstOrCreate([
109 - 'name' => \Abilities::DO_TEST,
110 - 'title' => 'Realizar Pruebas',
111 - ]);
112 -
113 - Bouncer::assign($superadmin)->to(1);
114 - Bouncer::allow($admin)->to($adminInstitution);
115 - Bouncer::allow($admin)->to($adminFamilyAccount);
116 - Bouncer::allow($user)->to($doTest);
83 + $roles = [];
84 + foreach(Roles::getConstants() as $rol) {
85 + $roles[$rol['name']] = Bouncer::role()->firstOrCreate($rol);
86 + }
87 +
88 + $abilities = [];
89 + foreach(Abilities::getConstants() as $ability) {
90 + $abilities[$ability['name']] = Bouncer::ability()->firstOrCreate($ability);
91 + }
92 +
93 + // Asignar superadmin a usuario 1
94 + Bouncer::assign($roles[Roles::SUPERADMIN['name']])->to(1);
95 +
96 + // Permitir a Admin administrar institucion
97 + Bouncer::allow($roles[Roles::ADMIN['name']])-
>to($abilities[Abilities::MANAGE_INSTITUTIONS['name']]);
98 +
99 + // Permitir a Admin administrar cta. personal
100 + Bouncer::allow($roles[Roles::ADMIN['name']])-
>to($abilities[Abilities::MANAGE_PERSONAL_ACCOUNTS['name']]);
101 +

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 7/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

102 + // Permitir a Usuario realizar pruebas


103 + Bouncer::allow($roles[Roles::USER['name']])->to($abilities[Abilities::DO_TESTS['name']]);
117 104 }
118 105
119 106 /**
... ...

  database/seeds/BouncerSeeder.php
... ... @@ -11,10 +11,10 @@ class BouncerSeeder extends Seeder
11 11 */
12 12 public function run()
13 13 {
14 - Bouncer::assign(\Roles::ADMIN)->to(2);
15 - Bouncer::assign(\Roles::USUARIO)->to(3);
16 - Bouncer::assign(\Roles::USUARIO)->to(4);
17 - Bouncer::assign(\Roles::USUARIO)->to(5);
18 - Bouncer::assign(\Roles::USUARIO)->to(6);
14 + Bouncer::assign(\Roles::ADMIN['name'])->to(2);
15 + Bouncer::assign(\Roles::USER['name'])->to(3);
16 + Bouncer::assign(\Roles::USER['name'])->to(4);
17 + Bouncer::assign(\Roles::USER['name'])->to(5);
18 + Bouncer::assign(\Roles::USER['name'])->to(6);
19 19 }
20 20 }

  database/seeds/ClientSeeder.php 0 → 100644
1 + <?php
2 +
3 + use App\Models\Client;
4 + use Illuminate\Database\Seeder;
5 +
6 + class ClientSeeder extends Seeder
7 +{
8 + /**
9 + * Run the database seeds.
10 + *
11 + * @return void
12 + */
13 + public function run()
14 + {
15 + Client::create([
16 + 'name' => 'Instituto Educativo Maria Gutierrez',
17 + 'email' => 'gerencia@magutierrez.edu.co',
18 + 'phone' => '+57(1)1111111',
19 + 'address' => 'Calle 1 Carrera 1 # 1',
20 + 'city' => 'Bogotá D.C.',
21 + 'country_code' => 'CO',
22 + 'client_type_id' => 1,
23 + 'plan_id' => 2,
24 + ]);
25 +
26 + Client::create([
27 + 'name' => 'Roberto Bolaños',
28 + 'email' => 'roberto@gmail.com',
29 + 'phone' => '+57(1)1111111',
30 + 'address' => 'Calle 1 Carrera 1 # 1',
31 + 'city' => 'Bogotá D.C.',
32 + 'country_code' => 'CO',
33 + 'client_type_id' => 2,
34 + 'plan_id' => 3,
35 + ]);
36 + }
37 +}

  database/seeds/ClientSeederexit.php 0 → 100644
1 + <?php
2 +
3 + use Illuminate\Database\Seeder;
4 +
5 + class ClientSeederexit extends Seeder
6 +{
7 + /**
8 + * Run the database seeds.
https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 8/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

9 + *
10 + * @return void
11 + */
12 + public function run()
13 + {
14 + //
15 + }
16 +}

  database/seeds/DatabaseSeeder.php
... ... @@ -13,5 +13,7 @@ class DatabaseSeeder extends Seeder
13 13 {
14 14 $this->call([UsersTableSeeder::class]);
15 15 $this->call([BouncerSeeder::class]);
16 + $this->call([PlanSeeder::class]);
17 + $this->call([ClientSeeder::class]);
16 18 }
17 19 }

  database/seeds/PlanSeeder.php 0 → 100644
1 + <?php
2 +
3 + use App\Models\Plan;
4 + use Illuminate\Database\Seeder;
5 +
6 + class PlanSeeder extends Seeder
7 +{
8 + /**
9 + * Run the database seeds.
10 + *
11 + * @return void
12 + */
13 + public function run()
14 + {
15 + Plan::create([
16 + 'name' => 'institucion_basico',
17 + 'description' => 'Plan Básico para Instituciones'
18 + ]);
19 +
20 + Plan::create([
21 + 'name' => 'personal_basico',
22 + 'description' => 'Plan Básico para cuentas personales y familiares'
23 + ]);
24 +
25 + }
26 +}

  database/seeds/UsersTableSeeder.php
... ... @@ -18,6 +18,7 @@ class UsersTableSeeder extends Seeder
18 18 'email' => 'admin@merani.com',
19 19 'email_verified_at' => now(),
20 20 'password' => Hash::make('secret'),
21 + 'client_id' => 2,
21 22 'created_at' => now(),
22 23 'updated_at' => now()
23 24 ]);
... ... @@ -27,6 +28,7 @@ class UsersTableSeeder extends Seeder
27 28 'email' => 'docente@merani.com',
28 29 'email_verified_at' => now(),
29 30 'password' => Hash::make('secret'),
31 + 'client_id' => 2,
30 32 'created_at' => now(),
31 33 'updated_at' => now()
32 34 ]);
... ... @@ -36,6 +38,7 @@ class UsersTableSeeder extends Seeder
36 38 'email' => 'familiar@merani.com',
37 39 'email_verified_at' => now(),
38 40 'password' => Hash::make('secret'),
41 + 'client_id' => 2,
39 42 'created_at' => now(),
40 43 'updated_at' => now()
41 44 ]);
... ... @@ -45,6 +48,7 @@ class UsersTableSeeder extends Seeder
https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 9/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

45 48 'email' => 'estudiante@merani.com',


46 49 'email_verified_at' => now(),
47 50 'password' => Hash::make('secret'),
51 + 'client_id' => 2,
48 52 'created_at' => now(),
49 53 'updated_at' => now()
50 54 ]);
... ... @@ -54,6 +58,7 @@ class UsersTableSeeder extends Seeder
54 58 'email' => 'usuario@merani.com',
55 59 'email_verified_at' => now(),
56 60 'password' => Hash::make('secret'),
61 + 'client_id' => 3,
57 62 'created_at' => now(),
58 63 'updated_at' => now()
59 64 ]);
... ...

 public/images/logos-colored.png 0 → 100644

149 KB

 public/images/school.jpg 0 → 100644

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 10/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

105 KB

  resources/views/_includes/dashboard/admin.blade.php 0 → 100644
1 + admin dashboard

  resources/views/_includes/dashboard/superadmin.blade.php 0 → 100644
1 + superadmin dashboard

  resources/views/_includes/dashboard/user.blade.php 0 → 100644
1 +
2 + <div class="row">
3 + <div class="col-md-4 mt-2">
4 + <x-stat :color="'success'" :icon="'clipboard-check'">
5 + <x-slot name="text">PRUEBAS REALIZADAS</x-slot>
6 + 220
7 + </x-stat>
8 + </div>
9 + <div class="col-md-4 mt-2">
10 + <x-stat :color="'warning'" :icon="'clipboard'">
11 + <x-slot name="text">PRUEBAS PENDIENTES</x-slot>
12 + 2
13 + </x-stat>
14 + </div>
15 + <div class="col-md-4 mt-2">
16 + <x-stat :color="'primary'" :icon="'clipboard-list'">
https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 11/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

17 + <x-slot name="text">PROMEDIO DE LAS PRUEBAS</x-slot>


18 + 290
19 + </x-stat>
20 + </div>
21 + </div>
22 +
23 + <div style="overflow-x: scroll;">
24 + <table class="table mt-5">
25 + <thead>
26 + <th>ID</th>
27 + <th>INSTRUMENTO</th>
28 + <th># DOCUMENTO</th>
29 + <th>ESTUDIANTE</th>
30 + <th>ESTADO</th>
31 + <th></th>
32 + </thead>
33 + <tbody>
34 + <tr>
35 + <td>1</td>
36 + <td>NIÑAS Y NIÑOS DE 4 A 7 AÑOS</td>
37 + <td>1010034950</td>
38 + <td>JUAN ALFONSO MORA A</td>
39 + <td><span class="badge badge-success">Realizada</span></td>
40 + </tr>
41 + <tr>
42 + <td>2</td>
43 + <td>NIÑAS Y NIÑOS DE 4 A 7 AÑOS</td>
44 + <td>1220984574</td>
45 + <td>YIRA MEDINA CASTRO</td>
46 + <td><span class="badge badge-success">Realizada</span></td>
47 + </tr>
48 + <tr>
49 + <td>3</td>
50 + <td>NIÑAS Y NIÑOS DE 8 A 11 AÑOS</td>
51 + <td>1129874578</td>
52 + <td>CARLOS MENDOZA LOZ</td>
53 + <td><span class="badge badge-light">Inactiva</span></td>
54 + </tr>
55 + <tr>
56 + <td>4</td>
57 + <td>NIÑAS Y NIÑOS DE 8 A 11 AÑOS</td>
58 + <td>1118984586</td>
59 + <td>ESTUDIANTE</td>
60 + <td><span class="badge badge-warning">Pendiente</span></td>
61 + </tr>
62 + <tr>
63 + <td>5</td>
64 + <td>NIÑAS Y NIÑOS DE 8 A 11 AÑOS</td>
65 + <td>1127893765</td>
66 + <td>ESTUDIANTE</td>
67 + <td><span class="badge badge-warning">Pendiente</span></td>
68 + </tr>
69 + </tbody>
70 + </table>
71 + </div>
72 +

  resources/views/admin/institutions/create.blade.php
1 1 @extends('layouts.app', ['title' => 'Crear Institución Educativa'])
2 - @section('title')
3 - CREAR INSTITUCIÓN EDUCATIVA
4 - @endsection
5 2 @section('content')
6 3 <div class="container">
7 4 <form action="{{route('admin.institutions.store')}}" method="post" class="w-75 mx-auto">
... ...

  resources/views/admin/institutions/index.blade.php
1 - @extends('layouts.app', ['title' => 'Administrar Instituciones'])
2 - @section('title')
3 - ADMINISTRAR INSTITUCIONES EDUCATIVAS
4 - @endsection
1 + @extends('layouts.app', ['title' => 'Administrar Instituciones Educativas'])

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 12/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

5 2 @section('content')
6 3 <div class="container">
7 4 <div class="row mb-3">
... ...

  resources/views/admin/institutions/show.blade.php
1 - @extends('layouts.app', ['title' => 'Administrar Instituciones'])
2 - @section('title')
3 - COLEGIO SAN PABLO SEXTO
4 - @endsection
1 + @extends('layouts.app', ['title' => 'Colegio San Pablo Sexto'])
5 2 @section('content')
6 3 <div class="container">
7 4
... ...

  resources/views/admin/roles/index.blade.php
1 1 @extends('layouts.app', ['title' => 'Administrar Roles y Permisos'])
2 - @section('title')
3 - ADMINISTRAR ROLES Y PERMISOS
4 - @endsection
5 2 @section('content')
6 3 <div class="container" id="roles">
7 4
... ...

  resources/views/admin/roles/show.blade.php

1 1 @extends('layouts.app', ['title' => 'Role: '.$role->name])


2 - @section('title')
3 - <b>ROL:</b> {{$role->name}}
4 - @endsection
5 2 @section('content')
6 - <div class="container" id="rol">
7 -
8 - <h3>{{$role->title}}</h3>
3 + <div class="container" id="abilities">
9 4
10 - <x-table>
11 - <x-slot name="headerRight">
12 - <a class="btn btn-primary" href="#" @click.prevent="">
13 - Agregar Nueva Habilidad
14 - </a>
15 - </x-slot>
16 - <table class="table align-items-center table-flush table-hover">
17 - <thead class="thead-light">
18 - <tr>
19 - <th>Id</th>
20 - <th>Rol</th>
21 - <th>Descripción</th>
22 - <th>Usuarios</th>
23 - <th scope="col"></th>
24 - </tr>
25 - </thead>
26 - <tbody class="list">
27 - @foreach($role->abilities as $ability)
28 - <tr>
29 - <td>
30 - {{$ability->id}}
31 - </td>
32 - <td class="name">
33 - {{$ability->name}}
34 - </td>
35 - <td>
36 - {{$ability->title}}
37 - </td>
38 - <td class="text-center">
39 - {{$ability->users->count()}}
40 - </td>
41 - <td class="text-right">
42 - <a href="#"
43 - class="btn btn-sm btn-outline-info py-1 px-2 mr-1"
44 - title="Editar"
45 - @click.prevent="showModalEdit({
https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 13/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

46 - id: '{{$ability->id}}',
47 - name: '{{$ability->name}}',
48 - title: '{{$ability->title}}'
49 - })">
50 - <i class="fa fa-edit"></i>
51 - </a>
52 - <a href="#"
53 - class="btn btn-sm btn-outline-danger py-1 px-2 mr-1"
54 - title="Eliminar"
55 - @click.prevent="destroy('{{$ability->id}}')">
56 - <i class="fa fa-trash"></i>
57 - </a>
58 - <form action="{{route('admin.abilities.destroy', $ability)}}"
59 - method="post"
60 - id="destroy-{{$ability->id}}"
61 - class="d-none">
62 - @csrf @method('delete')
63 - </form>
64 - </td>
65 - </tr>
66 - @endforeach
67 - </tbody>
68 - </table>
69 - </x-table>
70 -
71 - <div class="modal fade" id="actionModal" tabindex="-1" ability="dialog" aria-
labelledby="actionModalLabel" aria-hidden="true">
72 - <div class="modal-dialog" ability="document">
73 - <div class="modal-content">
74 - <div class="modal-header">
75 - <h5 class="modal-title" id="actionModalLabel">
76 - @{{ createMode ? 'Crear Habilidad' : 'Editar Habilidad: ' + entity.name }}
77 - </h5>
78 - <button type="button" class="close" data-dismiss="modal" aria-label="Close">
79 - <span aria-hidden="true">&times;</span>
80 - </button>
81 - </div>
82 - <div class="modal-body">
83 - <form :action="createMode ? '{{route('admin.roles.store')}}'
84 - : '/admin/roles/'+entity.id+''" method="post">
85 - @csrf
86 - <template v-if="!createMode">@method('put')</template>
5 + <p><span><b>Descripción del rol: </b></span> <br> {{$role->title}}</p>
87 6
88 - <div class="form-group">
89 - <label for="">Nombre</label>
90 - <input class="form-control"
91 - type="text"
92 - name="name"
93 - required
94 - v-model="entity.name">
95 - </div>
7 + <form action="{{route('admin.roles.sync-abilities', $role)}}" method="post">
8 + @csrf
96 9
97 - <div class="form-group">
98 - <label for="">Título</label>
99 - <input class="form-control"
100 - type="text"
101 - name="title"
102 - required
103 - v-model="entity.title">
104 - </div>
10 + <p>Seleccione las habilidades para este rol:</p>
105 11
106 - <button type="submit" id="submit" class="d-none"></button>
107 - </form>
12 + <div class="d-flex flex-wrap mb-3">
13 + @forelse($abilities as $ability)
14 + <div class="form-group mx-5">
15 + <input type="checkbox"
16 + name="abilities[]"
17 + value="{{$ability->id}}"
18 + id="ability-{{$ability->id}}"

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 14/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

19 + @if($role->abilities->first(fn($a) => $a->id == $ability->id)) checked


@endif>
20 + <label for="ability-{{$ability->id}}" class="mb-0">{{$ability->title}}</label>
108 21 </div>
109 - <div class="modal-footer">
110 - <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
111 - <button type="button" class="btn btn-primary" @click="save">Guardar</button>
112 - </div>
113 - </div>
22 + @empty
23 + <p>No hay habilidades para mostrar</p>
24 + @endforelse
114 25 </div>
115 - </div>
26 +
27 + <a href="{{route('admin.roles.index')}}" class="btn btn-secondary">Volver</a>
28 + <button class="btn btn-primary" type="submit">Guardar</button>
29 + </form>
30 +
116 31 </div>
117 32 @endsection
118 33 @push('js')
119 34 <script>
120 35 new Vue({
121 - el: '#rol',
36 + el: '#abilities',
122 37 data() {
123 38 return {
124 39 entity: {
... ...

  resources/views/auth/passwords/reset.blade.php

... ... @@ -2,7 +2,7 @@


2 2
3 3 @section('content')
4 4 @include('layouts.headers.guest')
5 -
5 +
6 6 <div class="container mt--8 pb-5">
7 7 <div class="row justify-content-center">
8 8 <div class="col-lg-5 col-md-7">
... ... @@ -24,7 +24,7 @@
24 24 <input class="form-control{{ $errors->has('email') ? ' is-invalid' :
'' }}" placeholder="{{ __('Email') }}" type="email" name="email" value="{{ $email ?? old('email') }}"
required autofocus>
25 25 </div>
26 26 @if ($errors->has('email'))
27 - <span class="invalid-feedback" role="alert">
27 + <span class="text-danger" role="alert">
28 28 <strong>{{ $errors->first('email') }}</strong>
29 29 </span>
30 30 @endif
... ... @@ -37,7 +37,7 @@
37 37 <input class="form-control{{ $errors->has('password') ? ' is-invalid'
: '' }}" name="password" placeholder="{{ __('Password') }}" type="password" required>
38 38 </div>
39 39 @if ($errors->has('password'))
40 - <span class="invalid-feedback" role="alert">
40 + <span class="text-danger" role="alert">
41 41 <strong>{{ $errors->first('password') }}</strong>
42 42 </span>
43 43 @endif
... ...

  resources/views/dashboard.blade.php
1 1 @extends('layouts.app', ['title' => 'Tablero'])
2 - @section('title')
3 - @docente()
4 - LISTADO DE INSTRUMENTOS
5 - @enddocente
6 - @endsection
7 2 @section('content')
8 3

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 15/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

9 4 <div class="container-fluid">
10 5
11 - @docente()
12 - <div class="row">
13 - <div class="col-md-4 mt-2">
14 - <x-stat :color="'success'" :icon="'clipboard-check'">
15 - <x-slot name="text">PRUEBAS REALIZADAS</x-slot>
16 - 220
17 - </x-stat>
18 - </div>
19 - <div class="col-md-4 mt-2">
20 - <x-stat :color="'warning'" :icon="'clipboard'">
21 - <x-slot name="text">PRUEBAS PENDIENTES</x-slot>
22 - 2
23 - </x-stat>
24 - </div>
25 - <div class="col-md-4 mt-2">
26 - <x-stat :color="'primary'" :icon="'clipboard-list'">
27 - <x-slot name="text">PROMEDIO DE LAS PRUEBAS</x-slot>
28 - 290
29 - </x-stat>
30 - </div>
31 - </div>
6 + @user
7 + @include('_includes.dashboard.user')
8 + @enduser
32 9
33 - <div style="overflow-x: scroll;">
34 - <table class="table mt-5">
35 - <thead>
36 - <th>ID</th>
37 - <th>INSTRUMENTO</th>
38 - <th># DOCUMENTO</th>
39 - <th>ESTUDIANTE</th>
40 - <th>ESTADO</th>
41 - <th></th>
42 - </thead>
43 - <tbody>
44 - <tr>
45 - <td>1</td>
46 - <td>NIÑAS Y NIÑOS DE 4 A 7 AÑOS</td>
47 - <td>1010034950</td>
48 - <td>JUAN ALFONSO MORA A</td>
49 - <td><span class="badge badge-success">Realizada</span></td>
50 - </tr>
51 - <tr>
52 - <td>2</td>
53 - <td>NIÑAS Y NIÑOS DE 4 A 7 AÑOS</td>
54 - <td>1220984574</td>
55 - <td>YIRA MEDINA CASTRO</td>
56 - <td><span class="badge badge-success">Realizada</span></td>
57 - </tr>
58 - <tr>
59 - <td>3</td>
60 - <td>NIÑAS Y NIÑOS DE 8 A 11 AÑOS</td>
61 - <td>1129874578</td>
62 - <td>CARLOS MENDOZA LOZ</td>
63 - <td><span class="badge badge-light">Inactiva</span></td>
64 - </tr>
65 - <tr>
66 - <td>4</td>
67 - <td>NIÑAS Y NIÑOS DE 8 A 11 AÑOS</td>
68 - <td>1118984586</td>
69 - <td>ESTUDIANTE</td>
70 - <td><span class="badge badge-warning">Pendiente</span></td>
71 - </tr>
72 - <tr>
73 - <td>5</td>
74 - <td>NIÑAS Y NIÑOS DE 8 A 11 AÑOS</td>
75 - <td>1127893765</td>
76 - <td>ESTUDIANTE</td>
77 - <td><span class="badge badge-warning">Pendiente</span></td>
78 - </tr>
79 - </tbody>
80 - </table>

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 16/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

81 - </div>
82 - @enddocente
10 + @admin
11 + @include('_includes.dashboard.admin')
12 + @endadmin
83 13
14 + @superadmin
15 + @include('_includes.dashboard.superadmin')
16 + @endsuperadmin
84 17
85 18
86 19 {{-- @include('layouts.footers.auth') --}}
... ...

  resources/views/layouts/app.blade.php
... ... @@ -43,10 +43,9 @@
43 43 <div class="main-content">
44 44 @include('layouts.navbars.navbar')
45 45 @include('layouts.headers.cards')
46 - @auth
47 - @include('layouts.headers.title')
48 - @endauth
49 - @yield('content')
46 + <div class="my-3">
47 + @yield('content')
48 + </div>
50 49 </div>
51 50
52 51 @guest()
... ...

  resources/views/layouts/headers/title.blade.php deleted 100644 → 0


1 - <div class="bg-secondary h2 pt-2 pb-0 px-3 font-weight-bold text-uppercase text-primary">
2 - @yield('title')
3 - </div>
4 - <hr class="mb-3 mt-0">

  resources/views/layouts/navbars/navs/auth.blade.php
... ... @@ -2,9 +2,9 @@
2 2 <nav class="navbar navbar-top navbar-expand-md navbar-dark" id="navbar-main">
3 3 <div class="container-fluid">
4 4 <!-- Brand -->
5 - <a class="h4 mb-0 text-white text-uppercase d-none d-lg-inline-block" href="{{ route('home') }}">
6 - {{-- {{$title ?? ''}} --}}
7 - </a>
5 + <p class="h1 mb-0 text-white text-uppercase d-none d-lg-inline-block">
6 + {{$title ?? ''}}
7 + </p>
8 8 <!-- Form -->
9 9 <form class="navbar-search navbar-search-dark form-inline mr-3 d-none d-md-flex ml-lg-auto">
10 10 <!-- <div class="form&#45;group mb&#45;0"> -->
... ... @@ -25,11 +25,8 @@
25 25 <img alt="Image placeholder" src="{{ asset('argon') }}/img/theme/team-4-
800x800.jpg">
26 26 </span>
27 27 <div class="media-body text-left ml-2 d-none d-lg-block">
28 - <span class="mb-0 text-sm font-weight-bold">{{ auth()->user()->name }}</span>
29 - <br>
30 - <small>
31 - {{ucfirst(strtolower(@substr(\Auth::user()->roles[0]->name,1)))}}
32 - </small>
28 + <p class="mb--1 text-sm font-weight-bold">{{ auth()->user()->name }}</p>
29 + <small>{{ucfirst(strtolower(\Auth::user()->roles[0]->title))}}</small>
33 30 </div>
34 31 </div>
35 32 </a>
... ...

  resources/views/layouts/navbars/sidebar.blade.php
... ... @@ -6,13 +6,7 @@
6 6 </button>
7 7 <!-- Brand -->

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 17/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

8 8 <a class="navbar-brand pt-0" href="{{ route('home') }}">


9 - @superadmin()
10 - <img src="{{ asset('images/logos.png') }}" class="navbar-brand-img" alt="...">
11 - @endsuperadmin
12 -
13 - @elt_admin()
14 - <img src="{{ asset('images/pablo6.jpg') }}" class="navbar-brand-img" alt="...">
15 - @endelt_docente
9 + <img src="{{ auth()->user()->client->image }}" class="navbar-brand-img" alt="...">
16 10 </a>
17 11 <!-- User -->
18 12 <ul class="nav align-items-center d-md-none">
... ... @@ -73,25 +67,24 @@
73 67 {{-- </form> --}}
74 68 <!-- Navigation -->
75 69 <ul class="navbar-nav">
76 - @docente()
77 - <li class="nav-item">
78 - <a class="nav-link" href="{{ route('home') }}">
79 - <i class="ni ni-tv-2 text-primary"></i>Tablero
80 - </a>
81 - </li>
82 - @enddocente
83 - @elt_docente()
84 70 <li class="nav-item">
85 - <a class="nav-link" href="{{route('tests.index')}}">
86 - <i class="ni ni-check-bold text-info"></i>Realizar Prueba
71 + <a class="nav-link" href="{{ route('home') }}">
72 + <i class="ni ni-tv-2 text-primary"></i>Tablero
87 73 </a>
88 74 </li>
89 - @endelt_docente
75 + @user
76 + <li class="nav-item">
77 + <a class="nav-link" href="{{route('tests.index')}}">
78 + <i class="ni ni-check-bold text-info"></i>Realizar Prueba
79 + </a>
80 + </li>
81 + @enduser
90 82 </ul>
83 +
91 84 <!-- Divider -->
92 85 <hr class="my-3">
93 86
94 - @egt_admin()
87 + @adminplus
95 88 <!-- Heading -->
96 89 <h6 class="navbar-heading text-muted">Administración</h6>
97 90 <!-- Navigation -->
... ... @@ -101,18 +94,26 @@
101 94 <!-- <i class="ni ni&#45;single&#45;02"></i>Usuarios -->
102 95 <!-- </a> -->
103 96 <!-- </li> -->
104 - <li class="nav-item">
105 - <a class="nav-link" href="{{route('admin.roles.index')}}">
106 - <i class="fa fa-user-tag"></i>Roles y permisos
107 - </a>
108 - </li>
97 + @superadmin
98 + <li class="nav-item">
99 + <a class="nav-link" href="{{route('admin.roles.index')}}">
100 + <i class="fa fa-user-tag"></i>Roles y permisos
101 + </a>
102 + </li>
103 + @endsuperadmin
109 104 <li class="nav-item">
110 105 <a class="nav-link" href="{{route('admin.institutions.index')}}">
111 106 <i class="ni ni-shop"></i>Instituciones
112 107 </a>
113 108 </li>
114 109 </ul>
115 - @endegt_admin
110 + @endadminplus
111 + </div>
112 + <div class="d-flex flex-column align-items-center">

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 18/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

113 + <img src="{{asset('images/logos-colored.png')}}" height="40">


114 + <p class="text-muted mb-0" style="font-size: 0.8rem !important">
115 + <small>Fundación Alberto Merani - &copy; 2020</small>
116 + </p>
116 117 </div>
117 118 </div>
118 119 </nav>

  resources/views/tests/index.blade.php
1 - @extends('layouts.app', ['title' => 'Realizar Prueba'])
2 - @section('title')
3 - OBSERVADOR DEL POTENCIAL DE APRENDIZAJE
4 - @endsection
1 + @extends('layouts.app', ['title' => 'Observador del Potencial de Aprendizaje'])
5 2 @section('content')
6 - <div class="container px-4">
3 + <div class="container px-5 py-3">
7 4
8 5 <h3>NIÑAS Y NIÑOS DE 4 A 7 AÑOS</h3>
9 6 <p>Estimado/a docente:</p>
... ...

  resources/views/tests/result.blade.php

1 - @extends('layouts.app', ['title' => 'Resultados de Prueba'])


2 - @section('title')
3 - RESULTADOS OBSERVADOR DEL POTENCIAL DE APRENDIZAJE
4 - @endsection
1 + @extends('layouts.app', ['title' => 'Resultados Observador del Potencial de Aprendizaje'])
5 2 @section('content')
6 3 <div class="container mb-5">
7 4
... ...

  resources/views/tests/show.blade.php
1 - @extends('layouts.app', ['title' => 'Realizar Prueba'])
2 - @section('title')
3 - <b>EL INTERÉS</b> - OBSERVADOR DEL POTENCIAL DE APRENDIZAJE
4 - @endsection
1 + @extends('layouts.app', ['title' => 'El Interés - Observador del Potencial de Aprendizaje'])
5 2 @section('content')
6 3 <div class="container mb-5">
7 4 <div class="card mb-3">
... ...

  routes/web.php
... ... @@ -19,9 +19,6 @@ Route::get('/', function () {
19 19
20 20 Auth::routes();
21 21
22 - Route::get('/home', 'HomeController@index')->name('home');
23 - Auth::routes();
24 -
25 22 Route::get('/home', 'HomeController@index')->name('home');
26 23
27 24 Route::group(['middleware' => 'auth'], function () {
... ... @@ -31,16 +28,29 @@ Route::group(['middleware' => 'auth'], function () {
31 28 Route::put('profile/password', ['as' => 'profile.password', 'uses' =>
'ProfileController@password']);
32 29 });
33 30
34 - Route::get('tests', 'TestController@index')->name('tests.index');
35 - Route::get('tests/{test}', 'TestController@show')->name('tests.show');
36 - Route::post('tests', 'TestController@result')->name('tests.result');
31 + Route::group([
32 + 'prefix' => 'tests',
33 + 'as' => 'tests.',
34 + 'middleware' => ['can:'.ability('DO_TESTS')],
35 + ], function() {
36 + Route::get('', 'TestController@index')->name('index');
37 + Route::get('{test}', 'TestController@show')->name('show');
38 + Route::post('', 'TestController@result')->name('result');
39 + });

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 19/20
1/8/2020 Termina administrar roles y permisos y requerimientos de Autorizacion y Autenticacion (e40c183c) · Commits · Guillermo Agudelo / apptalento · GitLab

37 40
38 41 Route::group([
39 42 'prefix' => 'admin',
40 43 'as' => 'admin.',
41 - 'namespace' => 'Admin'
44 + 'namespace' => 'Admin',
42 45 ], function() {
43 - Route::resource('institutions', 'InstitutionController');
44 - Route::resource('roles', 'RoleController')->except(['create', 'edit']);
45 - Route::resource('abilities', 'AbilityController')->only(['store', 'update', 'destroy']); //TODO:
Terminar esto
46 + Route::resource('institutions', 'InstitutionController')
47 + ->middleware(['can:'.ability('MANAGE_INSTITUTIONS')]);
48 +
49 + Route::post('roles/{role}/sync-abilities', 'RoleController@syncAbilities')
50 + ->name('roles.sync-abilities')
51 + ->middleware(['can:'.ability('MANAGE_ROLES')]);
52 +
53 + Route::resource('roles', 'RoleController')
54 + ->except(['create', 'edit'])
55 + ->middleware(['can:'.ability('MANAGE_ROLES')]);
46 56 });

Write a comment or drag your files here…

Markdown and quick actions are supported

https://gitlab.com/guille.agudelo/apptalento/-/commit/e40c183cc98e8368765ce70bb4b6668f28f4ae54 20/20

You might also like