Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
43f864c7
Commit
43f864c7
authored
Sep 14, 2021
by
Francesc Guasch
Browse files
refactor(auth): grant types
parent
5053766d
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/Ravada/Auth/SQL.pm
View file @
43f864c7
...
...
@@ -878,10 +878,12 @@ sub grant($self,$user,$permission,$value=1) {
.
Dumper
(
\
@perms
);
}
if
(
$value
eq
'
false
'
||
!
$value
)
{
$value
=
0
;
}
else
{
$value
=
1
;
if
(
$self
->
grant_type
(
$permission
)
eq
'
boolean
'
)
{
if
(
$value
eq
'
false
'
||
!
$value
)
{
$value
=
0
;
}
else
{
$value
=
1
;
}
}
return
0
if
!
$value
&&
!
$user
->
can_do
(
$permission
);
...
...
@@ -955,6 +957,7 @@ sub list_all_permissions($self) {
}
sub
grant_type
($self, $permission) {
return
'
boolean
'
if
!
exists
$self
->
{
_grant_type
}
->
{
$permission
};
return
$self
->
{
_grant_type
}
->
{
$permission
};
}
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment