Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Ravada-Mirror
Commits
0335daca
Commit
0335daca
authored
Apr 09, 2018
by
Francesc Guasch
Browse files
[#639] set default grants if user has none
parent
3227926a
Changes
2
Show whitespace changes
Inline
Side-by-side
lib/Ravada.pm
View file @
0335daca
...
...
@@ -161,6 +161,7 @@ sub _update_user_grants {
my
$user
=
Ravada::Auth::
SQL
->
search_by_id
(
$id
);
next
if
$user
->
name
()
eq
$USER_DAEMON_NAME
;
next
if
$user
->
grants
();
$USER_DAEMON
->
grant_user_permissions
(
$user
);
$USER_DAEMON
->
grant_admin_permissions
(
$user
)
if
$user
->
is_admin
;
}
...
...
lib/Ravada/Auth/SQL.pm
View file @
0335daca
...
...
@@ -736,6 +736,12 @@ sub can_change_settings($self, $id_domain=undef) {
return
0
;
}
sub
grants
($self) {
$self
->
_load_grants
()
if
!
$self
->
{
_grant
};
return
()
if
!
$self
->
{
_grant
};
return
%
{
$self
->
{
_grant
}};
}
sub
AUTOLOAD
($self) {
my
$name
=
$AUTOLOAD
;
...
...
Write
Preview
Supports
Markdown
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