Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
ptbcli
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniele Nicolodi
ptbcli
Commits
ba09775e
Commit
ba09775e
authored
1 year ago
by
Daniele Nicolodi
Browse files
Options
Downloads
Patches
Plain Diff
vorhabenACL: Check ACL on root folder too
parent
15bc0b1d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
vorhabenACL.py
+20
-1
20 additions, 1 deletion
vorhabenACL.py
with
20 additions
and
1 deletion
vorhabenACL.py
+
20
−
1
View file @
ba09775e
...
@@ -13,6 +13,7 @@ import openpyxl
...
@@ -13,6 +13,7 @@ import openpyxl
PATH
=
r
'
o:\4-3\4-3-Vorhaben
'
PATH
=
r
'
o:\4-3\4-3-Vorhaben
'
DATA
=
r
'
o:\4-3\4-3-Vorhaben\Zugriffsliste.xlsx
'
DATA
=
r
'
o:\4-3\4-3-Vorhaben\Zugriffsliste.xlsx
'
SUPERUSERS
=
{
'
benkle01
'
,
'
doersc01
'
,
'
kronja01
'
,
'
legero01
'
,
'
lisdat01
'
,
'
nicolo01
'
,
'
sterr01
'
}
IDS
=
{
IDS
=
{
'
luecke
'
:
2
,
'
luecke
'
:
2
,
'
klose
'
:
5
,
'
klose
'
:
5
,
...
@@ -212,6 +213,24 @@ def main():
...
@@ -212,6 +213,24 @@ def main():
def
verify
(
verbose
):
def
verify
(
verbose
):
"""
Verify ACL on folders.
"""
"""
Verify ACL on folders.
"""
errors
=
0
errors
=
0
acl
=
get_acl
(
PATH
)
for
user
,
permissions
in
acl
.
items
():
inherited
,
permissions
=
parse_permissions
(
permissions
)
if
inherited
:
continue
if
permissions
==
(
'
RX
'
,):
continue
assert
permissions
==
(
'
RX
'
,
'
W
'
,
'
DC
'
),
permissions
domain
,
name
=
user
.
split
(
'
\\
'
)
users
=
collect_users
(
name
)
not_authorized
=
users
-
SUPERUSERS
if
not_authorized
:
print
(
f
'
.
{
PATH
}
'
)
s
=
'
,
'
.
join
(
f
'
{
style
.
red
}{
name
}{
style
.
reset
}
'
for
name
in
sorted
(
not_authorized
))
print
(
f
'
{
s
}
'
)
errors
+=
1
master
=
parse_excel_sheet
()
master
=
parse_excel_sheet
()
for
entry
in
sorted
(
os
.
listdir
(
PATH
)):
for
entry
in
sorted
(
os
.
listdir
(
PATH
)):
if
entry
.
startswith
(
'
.
'
):
if
entry
.
startswith
(
'
.
'
):
...
@@ -247,7 +266,7 @@ def verify(verbose):
...
@@ -247,7 +266,7 @@ def verify(verbose):
print
(
f
'
.
{
style
.
reset
}
'
)
print
(
f
'
.
{
style
.
reset
}
'
)
s
=
'
,
'
.
join
(
f
'
{
style
.
red
}{
name
}{
style
.
reset
}
'
for
name
in
sorted
(
not_authorized
))
s
=
'
,
'
.
join
(
f
'
{
style
.
red
}{
name
}{
style
.
reset
}
'
for
name
in
sorted
(
not_authorized
))
print
(
f
'
{
s
}
'
)
print
(
f
'
{
s
}
'
)
errors
=
1
errors
+
=
1
sys
.
exit
(
errors
)
sys
.
exit
(
errors
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment