Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/sql groups #2041

Merged
merged 36 commits into from
Apr 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
62bbce4
wip(test): check access by group
frankiejol Mar 26, 2024
6d9da82
test: list bases access
frankiejol Mar 26, 2024
03568b8
wip: group base code
frankiejol Mar 26, 2024
91af9df
wip: group management backend
frankiejol Mar 27, 2024
231ea89
wip(frontend): list local and ldap groups
frankiejol Mar 27, 2024
9ec7bd0
wip(frontend): list users and groups
frankiejol Mar 28, 2024
d044e2d
wip: list local groups for access settings
frankiejol Mar 28, 2024
a1618b9
wip(frontend): groups API and tests
frankiejol Apr 4, 2024
521c61e
wip (frontend): templates wit new groups API
frankiejol Apr 4, 2024
22d6761
wip(frontend): show sql groups when no LDAP enabled
frankiejol Apr 5, 2024
eb177b4
test: allow local-groups tag
frankiejol Apr 8, 2024
4b52e16
wip(bookings): test local group
frankiejol Apr 8, 2024
6351134
wip: booking local group
frankiejol Apr 8, 2024
022882c
wip: add and change local groups
frankiejol Apr 9, 2024
a657b02
wip: create booking with local groups
frankiejol Apr 9, 2024
23bf824
wip: fixed change groups clears pristine flag
frankiejol Apr 9, 2024
754ed76
wip: require one group assigned
frankiejol Apr 9, 2024
9376ac4
wip: default bookings is true and description
frankiejol Apr 9, 2024
71be099
wip: hide LDAP groups select when no LDAP
frankiejol Apr 9, 2024
bb995c8
wip: now bookings are enabled by default
frankiejol Apr 10, 2024
6cd2c4a
wip(doc): new methods
frankiejol Apr 10, 2024
a8ef18c
wip: cloacked angular while loading
frankiejol Apr 11, 2024
4f3ecd5
wip(frontend): upload members
frankiejol Apr 11, 2024
73d6c3e
wip: upload group members
frankiejol Apr 11, 2024
f56443b
wip(CLI): upload group members
frankiejol Apr 12, 2024
88cf2ed
wip: manage access with id_group
frankiejol Apr 15, 2024
23970a0
wip: add and remove access by id_group
frankiejol Apr 15, 2024
7d9199c
wip(frontend): id group
frankiejol Apr 15, 2024
020f71a
wip: working with id group
frankiejol Apr 16, 2024
843dc3c
wip: create groups_local table before
frankiejol Apr 18, 2024
e5a40a2
Merge branch 'main' into feat/sql_groups
frankiejol Apr 18, 2024
d93f471
wip: services do not support slash
frankiejol Apr 18, 2024
4be3179
wip: hide base when removing from group
frankiejol Apr 18, 2024
e9bfd13
wip: test disabled groups
frankiejol Apr 18, 2024
b5616b6
wip: hide clone when not allowed to access group
frankiejol Apr 18, 2024
a00f16d
wip: filter groups
frankiejol Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
wip(frontend): groups API and tests
  • Loading branch information
frankiejol committed Apr 4, 2024
commit a1618b91b0f31694e41995be931f680ff0cba3fe
10 changes: 2 additions & 8 deletions script/rvd_front
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,7 @@ get '/machine/list_access_groups/#type/#id_domain' => sub {
return $c->render( json => [ $domain->list_access_groups($c->stash('type')) ] );
};

get '/machine/add_access_group/#type/#group/#id_domain' => sub($c) {
get '/machine/add_access_group/#type/#id_domain/#group' => sub($c) {
my $type = $c->stash('type');
my $id_domain = $c->stash('id_domain');
my $group = $c->stash('group');
Expand All @@ -1394,7 +1394,7 @@ get '/machine/add_access_group/#type/#group/#id_domain' => sub($c) {
return $c->render( json => { ok => $ok, error => $@ });
};

get '/machine/remove_access_group/#type/#group/#id_domain' => sub($c) {
get '/machine/remove_access_group/#type/#id_domain/#group' => sub($c) {

my $sth = $RAVADA->_dbh->prepare("DELETE FROM group_access WHERE id_domain=? "
." AND name=?"
Expand Down Expand Up @@ -2388,12 +2388,6 @@ sub _search_user($c,$name='') {
return $c->render(json => {found => $found , count => scalar(@$list_found) } );
};

get '/list_ldap_groups' => sub($c) {
return access_denied($c) unless $USER->can_view_groups || $USER->can_manage_groups;

return _list_ldap_groups($c,'*');
};

get '/group/#type/list_members/#name' => sub($c) {
return access_denied($c) if !$USER->can_view_groups;

Expand Down
6 changes: 3 additions & 3 deletions t/mojo/70_groups.t
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ sub test_list_groups($type, $group_name) {

sub test_add_access($type,$group_name, $user_name, $id_domain) {

$t->get_ok("/machine/add_access_group/$type/$group_name/$id_domain")
$t->get_ok("/machine/add_access_group/$type/$id_domain/$group_name")
->status_is(200);
my $result = decode_json($t->tx->res->body);
is($result->{error},'');
Expand Down Expand Up @@ -183,7 +183,7 @@ sub test_add_access($type,$group_name, $user_name, $id_domain) {
}

sub test_remove_access($type, $group_name, $user_name, $id_domain) {
$t->get_ok("/machine/remove_access_group/$type/$group_name/$id_domain")
$t->get_ok("/machine/remove_access_group/$type/$id_domain/$group_name")
->status_is(200);
$t->get_ok("/machine/list_access_groups/$type/$id_domain")->status_is(200);

Expand Down Expand Up @@ -219,7 +219,7 @@ sub test_group_removed($type, $group_name, $user_name, $id_domain) {

$t->post_ok("/group/$type/add_member", json => {id_user => $user->id, group => $group_name })->status_is(200);

$t->get_ok("/machine/add_access_group/$type/$group_name/$id_domain")
$t->get_ok("/machine/add_access_group/$type/$id_domain/$group_name")
->status_is(200);

$t->get_ok("/group/$type/remove/$group_name")->status_is(200);
Expand Down