Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
haskell-gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Julien Moutinho
haskell-gargantext
Commits
32bf4794
Commit
32bf4794
authored
Oct 12, 2023
by
Alfredo Di Napoli
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable policy check for now
parent
146c2eb0
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
PolicyCheck.hs
src/Gargantext/API/Auth/PolicyCheck.hs
+4
-2
Private.hs
test/Test/API/Private.hs
+4
-4
No files found.
src/Gargantext/API/Auth/PolicyCheck.hs
View file @
32bf4794
...
@@ -147,9 +147,11 @@ nodeSuper = BConst . Positive . AC_master_user
...
@@ -147,9 +147,11 @@ nodeSuper = BConst . Positive . AC_master_user
nodeDescendant
::
NodeId
->
BoolExpr
AccessCheck
nodeDescendant
::
NodeId
->
BoolExpr
AccessCheck
nodeDescendant
=
BConst
.
Positive
.
AC_node_descendant
nodeDescendant
=
BConst
.
Positive
.
AC_node_descendant
-- FIXME(adinapoli) Checks temporarily disabled.
nodeChecks
::
NodeId
->
BoolExpr
AccessCheck
nodeChecks
::
NodeId
->
BoolExpr
AccessCheck
nodeChecks
nid
=
nodeChecks
_nid
=
alwaysAllow
nodeUser
nid
`
BOr
`
nodeSuper
nid
`
BOr
`
nodeDescendant
nid
where
_disabled
=
nodeUser
_nid
`
BOr
`
nodeSuper
_nid
`
BOr
`
nodeDescendant
_nid
alwaysAllow
::
BoolExpr
AccessCheck
alwaysAllow
::
BoolExpr
AccessCheck
alwaysAllow
=
BConst
.
Positive
$
AC_always_allow
alwaysAllow
=
BConst
.
Positive
$
AC_always_allow
...
...
test/Test/API/Private.hs
View file @
32bf4794
...
@@ -116,8 +116,8 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
...
@@ -116,8 +116,8 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
it
"forbids 'alice' to see others node private info"
$
\
((
_testEnv
,
port
),
app
)
->
do
it
"forbids 'alice' to see others node private info"
$
\
((
_testEnv
,
port
),
app
)
->
do
withApplication
app
$
do
withApplication
app
$
do
withValidLogin
port
"alice"
(
GargPassword
"alice"
)
$
\
token
->
do
withValidLogin
port
"alice"
(
GargPassword
"alice"
)
$
\
token
->
do
protected
token
"GET"
(
mkUrl
port
"/node/1"
)
""
let
_unused
=
protected
token
"GET"
(
mkUrl
port
"/node/1"
)
""
`
shouldRespondWith
`
403
`
shouldRespondWith
`
403
in
liftIO
$
pendingWith
"POLICY CHECK DISABLED FOR NOW (ISSUE #279)"
describe
"GET /api/v1.0/tree"
$
do
describe
"GET /api/v1.0/tree"
$
do
it
"unauthorised users shouldn't see anything"
$
\
((
_testEnv
,
port
),
app
)
->
do
it
"unauthorised users shouldn't see anything"
$
\
((
_testEnv
,
port
),
app
)
->
do
...
@@ -133,5 +133,5 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
...
@@ -133,5 +133,5 @@ tests = sequential $ aroundAll withTestDBAndPort $ do
it
"forbids 'alice' to see others node private info"
$
\
((
_testEnv
,
port
),
app
)
->
do
it
"forbids 'alice' to see others node private info"
$
\
((
_testEnv
,
port
),
app
)
->
do
withApplication
app
$
do
withApplication
app
$
do
withValidLogin
port
"alice"
(
GargPassword
"alice"
)
$
\
token
->
do
withValidLogin
port
"alice"
(
GargPassword
"alice"
)
$
\
token
->
do
protected
token
"GET"
(
mkUrl
port
"/tree/1"
)
""
let
_unused
=
protected
token
"GET"
(
mkUrl
port
"/tree/1"
)
""
`
shouldRespondWith
`
403
`
shouldRespondWith
`
403
in
liftIO
$
pendingWith
"POLICY CHECK DISABLED FOR NOW (ISSUE #279)"
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