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
106f28f4
Commit
106f28f4
authored
Oct 22, 2021
by
Francesc Guasch
Browse files
doc: comment public methods
also fix best practice
parent
9ba9b661
Changes
4
Hide whitespace changes
Inline
Side-by-side
lib/Ravada/Auth.pm
View file @
106f28f4
...
...
@@ -100,7 +100,7 @@ sub login_external {
return
$login_ok
;
}
}
return
undef
;
return
;
}
=head2 enable_LDAP
...
...
lib/Ravada/Auth/SQL.pm
View file @
106f28f4
...
...
@@ -961,6 +961,12 @@ sub list_all_permissions($self) {
return
@list2
;
}
=head2 grant_type
Returns the type of a grant type, currently it can be 'boolaean' or 'int'
=cut
sub
grant_type
($self, $permission) {
return
'
boolean
'
if
!
exists
$self
->
{
_grant_type
}
->
{
$permission
};
return
$self
->
{
_grant_type
}
->
{
$permission
};
...
...
@@ -1129,6 +1135,14 @@ sub grants($self) {
return
%
{
$self
->
{
_grant
}};
}
=head2 grants_info
Returns a list of the permissions granted to an user as a hash.
Each entry is a reference to a list where the first value is
the grant and the second the type
=cut
sub
grants_info
($self) {
my
%grants
=
$self
->
grants
();
my
%grants_info
;
...
...
lib/Ravada/Domain.pm
View file @
106f28f4
...
...
@@ -706,7 +706,7 @@ sub _around_add_volume {
confess
"
Error: volume
$name
already exists
"
if
grep
{
$_
->
info
->
{
name
}
eq
$name
}
$self
->
list_volumes_info
;
}
confess
"
Error: target
$args
{target} already exists
"
confess
"
Error: target
$args
{target} already exists
in domain
"
.
$self
->
name
if
grep
{
$_
->
info
->
{
target
}
eq
$args
{
target
}
}
$self
->
list_volumes_info
;
my
$ok
=
$self
->
$orig
(
%args
);
...
...
lib/Ravada/Front.pm
View file @
106f28f4
...
...
@@ -1343,6 +1343,16 @@ sub settings_global($self) {
return
$self
->
_get_settings
();
}
=head2 setting
Sets or gets a global setting parameter
$rvd_front->('debug')
Settings are defined and stored in the table settings in the database.
=cut
sub
setting
($self, $name, $new_value=undef) {
confess
"
Error: wrong new value '
$new_value
' for
$name
"
...
...
@@ -1393,6 +1403,15 @@ sub _settings_by_id($self) {
return
$orig_settings
;
}
=head2 feature
Returns if a feature is available
if ($rvd_front->$feature('ldap')) {
....
=cut
sub
feature
($self,$name=undef) {
if
(
!
defined
$name
)
{
my
$feature
;
...
...
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