forked from proxmox-mirrors/proxmox
access-control: minor code cleanup
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
5daf898b14
commit
4197c0e26e
@ -84,10 +84,7 @@ impl AclTreeNode {
|
|||||||
|
|
||||||
for (role, propagate) in roles {
|
for (role, propagate) in roles {
|
||||||
if *propagate || leaf {
|
if *propagate || leaf {
|
||||||
if access_conf()
|
if access_conf().role_no_access() == Some(role) {
|
||||||
.role_no_access()
|
|
||||||
.map_or_else(|| false, |r| r == role)
|
|
||||||
{
|
|
||||||
// return a map with a single role 'NoAccess'
|
// return a map with a single role 'NoAccess'
|
||||||
let mut map = HashMap::new();
|
let mut map = HashMap::new();
|
||||||
map.insert(role.to_string(), false);
|
map.insert(role.to_string(), false);
|
||||||
@ -103,8 +100,7 @@ impl AclTreeNode {
|
|||||||
fn extract_group_roles(&self, _user: &Userid, leaf: bool) -> HashMap<String, bool> {
|
fn extract_group_roles(&self, _user: &Userid, leaf: bool) -> HashMap<String, bool> {
|
||||||
let mut map = HashMap::new();
|
let mut map = HashMap::new();
|
||||||
|
|
||||||
#[allow(clippy::for_kv_map)]
|
for roles in self.groups.values() {
|
||||||
for (_group, roles) in &self.groups {
|
|
||||||
let is_member = false; // fixme: check if user is member of the group
|
let is_member = false; // fixme: check if user is member of the group
|
||||||
if !is_member {
|
if !is_member {
|
||||||
continue;
|
continue;
|
||||||
@ -112,10 +108,7 @@ impl AclTreeNode {
|
|||||||
|
|
||||||
for (role, propagate) in roles {
|
for (role, propagate) in roles {
|
||||||
if *propagate || leaf {
|
if *propagate || leaf {
|
||||||
if access_conf()
|
if access_conf().role_no_access() == Some(role) {
|
||||||
.role_no_access()
|
|
||||||
.map_or_else(|| false, |r| r == role)
|
|
||||||
{
|
|
||||||
// return a map with a single role 'NoAccess'
|
// return a map with a single role 'NoAccess'
|
||||||
let mut map = HashMap::new();
|
let mut map = HashMap::new();
|
||||||
map.insert(role.to_string(), false);
|
map.insert(role.to_string(), false);
|
||||||
|
Loading…
Reference in New Issue
Block a user