forked from enviPath/enviPy
App Integration Secret Packages
This commit is contained in:
+5
-2
@@ -376,13 +376,12 @@ class PackageManager(object):
|
||||
groups = GroupManager.get_groups(user)
|
||||
|
||||
# EDIT START
|
||||
|
||||
if package.classification_level == Package.Classification.SECRET:
|
||||
if user.principal_type == user.PrincipalType.APP:
|
||||
if not user.app_details.secret_allowed or package.data_pool != user.app_details.data_pool:
|
||||
return False
|
||||
|
||||
if package.data_pool not in groups:
|
||||
elif package.data_pool not in groups:
|
||||
return False
|
||||
|
||||
# EDIT END
|
||||
@@ -444,6 +443,10 @@ class PackageManager(object):
|
||||
@staticmethod
|
||||
def check_package_classification(user, pack: Package):
|
||||
if pack.classification_level == Package.Classification.SECRET:
|
||||
if user.principal_type == user.PrincipalType.APP:
|
||||
if pack.data_pool == user.app_details.data_pool:
|
||||
return pack
|
||||
|
||||
if pack.data_pool.user_member.filter(id=user.id).exists():
|
||||
return pack
|
||||
|
||||
|
||||
Reference in New Issue
Block a user