-
Notifications
You must be signed in to change notification settings - Fork 81
Enh: More targeted drive prop set #4211
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
Merged
Merged
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
1cb14a0
wip
rakuy0 94165d5
wip
rakuy0 fb74cc3
back that out
rakuy0 a4926c2
coverage
rakuy0 8fba48a
more coverage
rakuy0 59c1e3a
add versinfo set for setDriveItemProp
rakuy0 1503153
Merge branch 'synapse-3xx' into rakuyo/drive-perms-n-targets
rakuy0 4ff1921
moar
rakuy0 3b4ea0e
remove
rakuy0 e6f31a6
Merge branch 'synapse-3xx' into rakuyo/drive-perms-n-targets
rakuy0 9e4fbfd
Merge branch 'synapse-3xx' into rakuyo/drive-perms-n-targets
rakuy0 3dbfdc4
more test
rakuy0 bf30817
Merge branch 'synapse-3xx' into rakuyo/drive-perms-n-targets
rakuy0 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,9 @@ def _reqInfoType(self, info, typename): | |
|
||
def getItemInfo(self, iden, typename=None): | ||
info = self._getItemInfo(s_common.uhex(iden)) | ||
if not info: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you supply a typename and the drive doesn't have that iden, you get an unhandled python Attribute error about NoneType not having a |
||
return | ||
|
||
if typename is not None: | ||
self._reqInfoType(info, typename) | ||
return info | ||
|
@@ -210,7 +213,7 @@ def setItemPerm(self, iden, perm): | |
|
||
def _setItemPerm(self, bidn, perm): | ||
info = self._reqItemInfo(bidn) | ||
info['perm'] = perm | ||
info['permissions'] = perm | ||
s_schemas.reqValidDriveInfo(info) | ||
self.slab.put(LKEY_INFO + bidn, s_msgpack.en(info), db=self.dbname) | ||
return info | ||
|
@@ -286,7 +289,7 @@ async def addItemInfo(self, info, path=None, reldir=rootdir): | |
info['kids'] = 0 | ||
info['parent'] = pariden | ||
|
||
info.setdefault('perm', {'users': {}, 'roles': {}}) | ||
info.setdefault('permissions', {'users': {}, 'roles': {}}) | ||
info.setdefault('version', (0, 0, 0)) | ||
|
||
s_schemas.reqValidDriveInfo(info) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.