Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
irods-clients
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Contributor 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
RDM Infrastructure
irods-clients
Commits
b4573c0d
Commit
b4573c0d
authored
3 years ago
by
Staiger, Christine
Browse files
Options
Downloads
Patches
Plain Diff
Adjusting irodsTreeView to Treeview in branch GUI.
parent
e116765f
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
irods-basicGUI/irodsTreeView.py
+29
-4
29 additions, 4 deletions
irods-basicGUI/irodsTreeView.py
with
29 additions
and
4 deletions
irods-basicGUI/irodsTreeView.py
+
29
−
4
View file @
b4573c0d
...
...
@@ -19,6 +19,9 @@ class IrodsModel(QStandardItemModel):
super
(
IrodsModel
,
self
).
__init__
(
parent
)
self
.
_checked_indeces
=
set
()
self
.
ic
=
irods_session
#Groups which the user id member of to check access rights on tree
self
.
userGroups
=
self
.
ic
.
getUserInfo
()[
1
]
self
.
irodsRootColl
=
"
/
"
+
self
.
ic
.
session
.
zone
self
.
TreeView
=
TreeView
self
.
clear
()
# Empty tree
...
...
@@ -39,13 +42,22 @@ class IrodsModel(QStandardItemModel):
def
setData
(
self
,
index
,
value
,
role
=
Qt
.
EditRole
):
if
role
==
Qt
.
CheckStateRole
:
#filename = self.data(index)
if
value
==
Qt
.
Checked
:
#check irods ACLs for access rights
path
=
self
.
irodsPathFromTreeIdx
(
index
)
reqAcls
=
[(
'
own
'
,
path
,
group
,
self
.
ic
.
session
.
zone
)
for
group
in
self
.
userGroups
]
reqAcls
.
extend
([(
'
write
'
,
path
,
group
,
self
.
ic
.
session
.
zone
)
\
for
group
in
self
.
userGroups
])
acls
=
set
([(
acl
.
access_name
,
acl
.
path
,
acl
.
user_name
,
acl
.
user_zone
)
for
acl
in
self
.
ic
.
getPermissions
(
path
)])
# Block checking of home item (found no easy way to remove the checkbox)
if
self
.
data
(
index
)
==
"
home
"
:
message
=
"
Cannot up/download to home collection
"
QMessageBox
.
information
(
self
.
TreeView
,
'
Error
'
,
message
)
if
acls
.
intersection
(
reqAcls
)
==
set
()
:
message
=
"
ERROR, insufficient rights:
\n
Cannot select
"
+
path
QMessageBox
.
information
(
self
.
TreeView
,
'
Error
'
,
message
)
#logging.info("Filedownload:" + message)
return
False
...
...
@@ -203,6 +215,19 @@ class IrodsModel(QStandardItemModel):
seen
[
irodsID
]
=
parent
.
child
(
parent
.
rowCount
()
-
1
)
def
getParentIdx
(
self
,
position
):
try
:
#index when right mouse click
modelIndex
=
self
.
tree
.
indexAt
(
position
)
if
not
modelIndex
.
isValid
():
return
except
:
#index when expand is clicked
modelIndex
=
position
treeItem
=
self
.
itemFromIndex
(
modelIndex
)
parent
=
treeItem
.
parent
()
def
refreshSubTree
(
self
,
position
):
try
:
#index when right mouse click
modelIndex
=
self
.
tree
.
indexAt
(
position
)
...
...
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