develop-bayer #1

Open
jebus wants to merge 24 commits from develop-bayer into develop
Showing only changes of commit 2a8974b1b8 - Show all commits
+5 -2
View File
@@ -376,13 +376,12 @@ class PackageManager(object):
groups = GroupManager.get_groups(user) groups = GroupManager.get_groups(user)
# EDIT START # EDIT START
if package.classification_level == Package.Classification.SECRET: if package.classification_level == Package.Classification.SECRET:
if user.principal_type == user.PrincipalType.APP: if user.principal_type == user.PrincipalType.APP:
if not user.app_details.secret_allowed or package.data_pool != user.app_details.data_pool: if not user.app_details.secret_allowed or package.data_pool != user.app_details.data_pool:
return False return False
if package.data_pool not in groups: elif package.data_pool not in groups:
return False return False
# EDIT END # EDIT END
@@ -444,6 +443,10 @@ class PackageManager(object):
@staticmethod @staticmethod
def check_package_classification(user, pack: Package): def check_package_classification(user, pack: Package):
if pack.classification_level == Package.Classification.SECRET: 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(): if pack.data_pool.user_member.filter(id=user.id).exists():
return pack return pack