Commit 106f28f4 authored by Francesc Guasch's avatar Francesc Guasch
Browse files

doc: comment public methods

also fix best practice
parent 9ba9b661
......@@ -100,7 +100,7 @@ sub login_external {
return $login_ok;
}
}
return undef;
return;
}
=head2 enable_LDAP
......
......@@ -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;
......
......@@ -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);
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment