Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
96f2461f
authored
Dec 14, 2016
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
license controller ready
parent
e1cadbc7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
0 deletions
sails/roles/database/files/pictodb-schema.sql
sails/src/config/policies.js
sails/src/config/routes.js
sails/roles/database/files/pictodb-schema.sql
View file @
96f2461f
...
...
@@ -299,6 +299,25 @@ COMMENT="Students information";
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `license`
--
CREATE
TABLE
IF
NOT
EXISTS
`license`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
,
`id_stu`
int
(
11
)
DEFAULT
NULL
,
`number`
varchar
(
16
)
CHARACTER
SET
utf8
COLLATE
utf8_bin
NOT
NULL
,
`activation_ts`
timestamp
(
3
)
NULL
,
`duration`
int
(
11
)
DEFAULT
0
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`number`
(
`number`
),
KEY
`id_stu`
(
`id_stu`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8
COLLATE
=
utf8_unicode_ci
AUTO_INCREMENT
=
19
COMMENT
=
"Student license number"
;
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `stu_picto`
--
...
...
@@ -509,6 +528,11 @@ ALTER TABLE `student`
ADD
CONSTRAINT
`student_ibfk_1`
FOREIGN
KEY
(
`id_off`
)
REFERENCES
`office`
(
`id`
);
--
-- Filtros para la tabla `license`
--
ALTER
TABLE
`license`
ADD
CONSTRAINT
`license_fk_1`
FOREIGN
KEY
(
`id_stu`
)
REFERENCES
`student`
(
`id`
);
--
-- Filtros para la tabla `supervisor`
--
ALTER
TABLE
`supervisor`
...
...
sails/src/config/policies.js
View file @
96f2461f
...
...
@@ -111,6 +111,13 @@ module.exports.policies = {
delete_picto
:
[
'tokenAuth'
,
'isSupervisorOfStudent'
]
},
LicenseController
:
{
/* create: ['tokenAuth', 'isAdmin'],
activate: ['tokenAuth']*/
create
:
true
,
activate
:
true
},
SupervisorController
:
{
list
:
[
'tokenAuth'
,
'isAdmin'
],
students
:
[
'tokenAuth'
],
...
...
sails/src/config/routes.js
View file @
96f2461f
...
...
@@ -39,6 +39,9 @@ module.exports.routes = {
'POST /instruction/template'
:
'MetaInstructionController.create'
,
'DELETE /instruction/template/:id'
:
'MetaInstructionController.destroy'
,
'POST /license'
:
'LicenseController.create'
,
'PUT /license/:number'
:
'LicenseController.activate'
,
'PUT /method/:id'
:
'MethodController.update'
,
'POST /method'
:
'MethodController.create'
,
'POST /method/new'
:
'MethodController.newMethod'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment