@@ -1753,6 +1753,33 @@ def rules_rescan(self, **kwargs):
17531753 self .opencti .app_logger .error ("[stix_core_object] Missing parameters: id" )
17541754 return None
17551755
1756+ """
1757+ Ask clear restriction
1758+
1759+ :param element_id: the Stix-Core-Object id
1760+ :return void
1761+ """
1762+
1763+ def clear_access_restriction (self , ** kwargs ):
1764+ element_id = kwargs .get ("element_id" , None )
1765+ if element_id is not None :
1766+ query = """
1767+ mutation StixCoreObjectEdit($id: ID!) {
1768+ stixCoreObjectEdit(id: $id) {
1769+ clearAccessRestriction
1770+ }
1771+ }
1772+ """
1773+ self .opencti .query (
1774+ query ,
1775+ {
1776+ "id" : element_id ,
1777+ },
1778+ )
1779+ else :
1780+ self .opencti .app_logger .error ("[stix_core_object] Missing parameters: id" )
1781+ return None
1782+
17561783 """
17571784 Ask enrichment with multiple connectors
17581785
@@ -1789,11 +1816,11 @@ def ask_enrichment(self, **kwargs):
17891816 :return void
17901817 """
17911818
1792- def organization_share (self , entity_id , organization_ids ):
1819+ def organization_share (self , entity_id , organization_ids , sharing_direct_container ):
17931820 query = """
1794- mutation StixCoreObjectEdit($id: ID!, $organizationId: [ID!]!) {
1821+ mutation StixCoreObjectEdit($id: ID!, $organizationId: [ID!]!, $directContainerSharing: Boolean ) {
17951822 stixCoreObjectEdit(id: $id) {
1796- restrictionOrganizationAdd(organizationId: $organizationId) {
1823+ restrictionOrganizationAdd(organizationId: $organizationId, directContainerSharing: $directContainerSharing ) {
17971824 id
17981825 }
17991826 }
@@ -1804,6 +1831,7 @@ def organization_share(self, entity_id, organization_ids):
18041831 {
18051832 "id" : entity_id ,
18061833 "organizationId" : organization_ids ,
1834+ "directContainerSharing" : sharing_direct_container ,
18071835 },
18081836 )
18091837
@@ -1815,11 +1843,13 @@ def organization_share(self, entity_id, organization_ids):
18151843 :return void
18161844 """
18171845
1818- def organization_unshare (self , entity_id , organization_ids ):
1846+ def organization_unshare (
1847+ self , entity_id , organization_ids , sharing_direct_container
1848+ ):
18191849 query = """
1820- mutation StixCoreObjectEdit($id: ID!, $organizationId: [ID!]!) {
1850+ mutation StixCoreObjectEdit($id: ID!, $organizationId: [ID!]!, $directContainerSharing: Boolean ) {
18211851 stixCoreObjectEdit(id: $id) {
1822- restrictionOrganizationDelete(organizationId: $organizationId) {
1852+ restrictionOrganizationDelete(organizationId: $organizationId, directContainerSharing: $directContainerSharing ) {
18231853 id
18241854 }
18251855 }
@@ -1830,6 +1860,7 @@ def organization_unshare(self, entity_id, organization_ids):
18301860 {
18311861 "id" : entity_id ,
18321862 "organizationId" : organization_ids ,
1863+ "directContainerSharing" : sharing_direct_container ,
18331864 },
18341865 )
18351866
0 commit comments