Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
gdd-sigma-poc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guillaume WANG
gdd-sigma-poc
Commits
8a3124f1
Commit
8a3124f1
authored
6 years ago
by
Guillaume WANG
Browse files
Options
Downloads
Patches
Plain Diff
add debugging console.logs
parent
4413a4ac
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app.ts
+5
-4
5 additions, 4 deletions
src/app.ts
src/graphql/models/authorization.ts
+7
-2
7 additions, 2 deletions
src/graphql/models/authorization.ts
with
12 additions
and
6 deletions
src/app.ts
+
5
−
4
View file @
8a3124f1
...
@@ -223,12 +223,13 @@ const context = async ({ req }): Promise<Context> => {
...
@@ -223,12 +223,13 @@ const context = async ({ req }): Promise<Context> => {
let
blah
=
{
let
blah
=
{
request
:
req
,
request
:
req
,
user
:
{
uid
:
uid
},
user
:
{
uid
:
uid
},
//models: null
models
:
{
models
:
{
auth
:
await
AuthorizationModel
.
create
(
uid
),
auth
:
await
AuthorizationModel
.
create
(
uid
),
user
:
new
UserModel
(
uid
),
user
:
null
,
//
new UserModel(uid),
group
:
new
GroupModel
(
uid
),
group
:
null
,
//
new GroupModel(uid),
message
:
new
MessageModel
(
uid
),
message
:
null
,
//
new MessageModel(uid),
request
:
new
RequestModel
(
uid
)
request
:
null
,
//
new RequestModel(uid)
}
}
};
};
console
.
log
(
"
finished constructing context
"
);
console
.
log
(
"
finished constructing context
"
);
...
...
This diff is collapsed.
Click to expand it.
src/graphql/models/authorization.ts
+
7
−
2
View file @
8a3124f1
...
@@ -41,11 +41,12 @@ export class AuthorizationModel {
...
@@ -41,11 +41,12 @@ export class AuthorizationModel {
*/
*/
static
async
create
(
uid
:
string
):
Promise
<
AuthorizationModel
>
{
static
async
create
(
uid
:
string
):
Promise
<
AuthorizationModel
>
{
let
model
=
new
AuthorizationModel
(
uid
);
let
model
=
new
AuthorizationModel
(
uid
);
console
.
log
(
"
constructing AuthorizationModel...
"
);
if
(
model
.
isAuthenticated
())
{
if
(
model
.
isAuthenticated
())
{
console
.
log
(
"
model is authenticated. fetching data...
"
);
await
model
.
fetchData
();
await
model
.
fetchData
();
}
}
console
.
log
(
"
finished constructing AuthorizationModel
"
);
return
model
;
return
model
;
}
}
...
@@ -66,7 +67,10 @@ export class AuthorizationModel {
...
@@ -66,7 +67,10 @@ export class AuthorizationModel {
* @async
* @async
*/
*/
async
fetchData
():
Promise
<
void
>
{
async
fetchData
():
Promise
<
void
>
{
console
.
log
(
"
calling UT.peek from ldap connector (User Tool)...
"
)
let
data
=
await
UT
.
peek
(
this
.
uid
);
let
data
=
await
UT
.
peek
(
this
.
uid
);
console
.
log
(
"
UT.peek returned with data:
"
);
console
.
log
(
data
);
this
.
viewerOf
=
await
Tools
.
viewerOf
(
data
);
this
.
viewerOf
=
await
Tools
.
viewerOf
(
data
);
this
.
memberOf
=
await
Tools
.
memberOf
(
data
);
this
.
memberOf
=
await
Tools
.
memberOf
(
data
);
...
@@ -102,6 +106,7 @@ export class AuthorizationModel {
...
@@ -102,6 +106,7 @@ export class AuthorizationModel {
* @return {boolean} Renvoie true si l'utilisateur est authentifié
* @return {boolean} Renvoie true si l'utilisateur est authentifié
*/
*/
isAuthenticated
():
boolean
{
isAuthenticated
():
boolean
{
console
.
log
(
"
running model.isAuthenticated...
"
);
return
(
this
.
uid
!=
AuthorizationModel
.
PUBLICUSER
&&
this
.
uid
!=
AuthorizationModel
.
ONPLATALUSER
);
return
(
this
.
uid
!=
AuthorizationModel
.
PUBLICUSER
&&
this
.
uid
!=
AuthorizationModel
.
ONPLATALUSER
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment