{"action":"created","comment":{"url":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/comments/49942973","id":49942973,"diff_hunk":"@@ -260,6 +285,36 @@ def _add_reference(self, addref, user):\n         self._aspace[addref.SourceNodeId].references.append(rdesc)\n         return ua.StatusCode()\n \n+    def delete_references(self, refs, user=User.Admin):\n+        result = []\n+        for ref in refs:\n+            result.append(self._delete_reference(ref, user))\n+        return result\n+\n+    def _delete_reference(self, item, user):\n+        if item.SourceNodeId not in self._aspace:\n+            return ua.StatusCode(ua.StatusCodes.BadSourceNodeIdInvalid)\n+        if item.TargetNodeId not in self._aspace:\n+            return ua.StatusCode(ua.StatusCodes.BadTargetNodeIdInvalid)\n+        if not user == User.Admin:\n+            return ua.StatusCode(ua.StatusCodes.BadUserAccessDenied)\n+\n+        for rdesc in self._aspace[item.SourceNodeId].references:\n+            if rdesc.NodeId is item.TargetNodeId:\n+                if rdesc.RefrenceTypeId != item.RefrenceTypeId:\n+                    return ua.StatusCode(ua.StatusCode.BadReferenceTypeInvalid)\n+                if rdesc.IsForward == item.IsForward or item.DeleteBidirectional:\n+                    self._aspace[item.SourceNodeId].references.remove(rdesc)\n+\n+        for rdesc in self._aspace[item.TargetNodeId].references:\n+            if rdesc.NodeId is item.SourceNodeId:\n+                if rdesc.RefrenceTypeId != item.RefrenceTypeId:\n+                    return ua.StatusCode(ua.StatusCode.BadReferenceTypeInvalid)\n+                if rdesc.IsForward == item.IsForward or item.DeleteBidirectional:\n+                    self._aspace[item.SourceNodeId].references.remove(rdesc)\n+\n+        return ua.StatusCode()\n+","path":"opcua/server/address_space.py","position":74,"original_position":74,"commit_id":"25c6deae2fc01fd97a09489db550b9f56bb445d7","original_commit_id":"25c6deae2fc01fd97a09489db550b9f56bb445d7","user":{"login":"oroulet","id":2564046,"avatar_url":"https://avatars.githubusercontent.com/u/2564046?v=3","gravatar_id":"","url":"https://api.github.com/users/oroulet","html_url":"https://github.com/oroulet","followers_url":"https://api.github.com/users/oroulet/followers","following_url":"https://api.github.com/users/oroulet/following{/other_user}","gists_url":"https://api.github.com/users/oroulet/gists{/gist_id}","starred_url":"https://api.github.com/users/oroulet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oroulet/subscriptions","organizations_url":"https://api.github.com/users/oroulet/orgs","repos_url":"https://api.github.com/users/oroulet/repos","events_url":"https://api.github.com/users/oroulet/events{/privacy}","received_events_url":"https://api.github.com/users/oroulet/received_events","type":"User","site_admin":false},"body":"We will need tests to check that works :-)","created_at":"2016-01-17T08:05:40Z","updated_at":"2016-01-17T08:05:40Z","html_url":"https://github.com/FreeOpcUa/python-opcua/pull/114#discussion_r49942973","pull_request_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/114","_links":{"self":{"href":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/comments/49942973"},"html":{"href":"https://github.com/FreeOpcUa/python-opcua/pull/114#discussion_r49942973"},"pull_request":{"href":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/114"}}},"pull_request":{"url":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/114","id":56264183,"html_url":"https://github.com/FreeOpcUa/python-opcua/pull/114","diff_url":"https://github.com/FreeOpcUa/python-opcua/pull/114.diff","patch_url":"https://github.com/FreeOpcUa/python-opcua/pull/114.patch","issue_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/114","number":114,"state":"open","locked":false,"title":"Server side deleting of nodes.","user":{"login":"destogl","id":1918204,"avatar_url":"https://avatars.githubusercontent.com/u/1918204?v=3","gravatar_id":"","url":"https://api.github.com/users/destogl","html_url":"https://github.com/destogl","followers_url":"https://api.github.com/users/destogl/followers","following_url":"https://api.github.com/users/destogl/following{/other_user}","gists_url":"https://api.github.com/users/destogl/gists{/gist_id}","starred_url":"https://api.github.com/users/destogl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/destogl/subscriptions","organizations_url":"https://api.github.com/users/destogl/orgs","repos_url":"https://api.github.com/users/destogl/repos","events_url":"https://api.github.com/users/destogl/events{/privacy}","received_events_url":"https://api.github.com/users/destogl/received_events","type":"User","site_admin":false},"body":"It is almost finished. There is not clear to me how to notify clients when subscribed node is deleted. As far as I understood, I have to use [trigger_statuschange function](https://github.com/FreeOpcUa/python-opcua/blob/master/opcua/server/internal_subscription.py#L185) but don't know how to access it from node... Any help welcome!","created_at":"2016-01-16T22:01:08Z","updated_at":"2016-01-17T08:05:40Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a946ef4b6aa96b334439a6fbc0021e5a48600a2e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/114/commits","review_comments_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/114/comments","review_comment_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/114/comments","statuses_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/statuses/25c6deae2fc01fd97a09489db550b9f56bb445d7","head":{"label":"iirob:master","ref":"master","sha":"25c6deae2fc01fd97a09489db550b9f56bb445d7","user":{"login":"iirob","id":4102842,"avatar_url":"https://avatars.githubusercontent.com/u/4102842?v=3","gravatar_id":"","url":"https://api.github.com/users/iirob","html_url":"https://github.com/iirob","followers_url":"https://api.github.com/users/iirob/followers","following_url":"https://api.github.com/users/iirob/following{/other_user}","gists_url":"https://api.github.com/users/iirob/gists{/gist_id}","starred_url":"https://api.github.com/users/iirob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iirob/subscriptions","organizations_url":"https://api.github.com/users/iirob/orgs","repos_url":"https://api.github.com/users/iirob/repos","events_url":"https://api.github.com/users/iirob/events{/privacy}","received_events_url":"https://api.github.com/users/iirob/received_events","type":"Organization","site_admin":false},"repo":{"id":37647800,"name":"python-opcua","full_name":"iirob/python-opcua","owner":{"login":"iirob","id":4102842,"avatar_url":"https://avatars.githubusercontent.com/u/4102842?v=3","gravatar_id":"","url":"https://api.github.com/users/iirob","html_url":"https://github.com/iirob","followers_url":"https://api.github.com/users/iirob/followers","following_url":"https://api.github.com/users/iirob/following{/other_user}","gists_url":"https://api.github.com/users/iirob/gists{/gist_id}","starred_url":"https://api.github.com/users/iirob/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iirob/subscriptions","organizations_url":"https://api.github.com/users/iirob/orgs","repos_url":"https://api.github.com/users/iirob/repos","events_url":"https://api.github.com/users/iirob/events{/privacy}","received_events_url":"https://api.github.com/users/iirob/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/iirob/python-opcua","description":"Pure Python OPC-UA Client and Server","fork":true,"url":"https://api.github.com/repos/iirob/python-opcua","forks_url":"https://api.github.com/repos/iirob/python-opcua/forks","keys_url":"https://api.github.com/repos/iirob/python-opcua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/iirob/python-opcua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/iirob/python-opcua/teams","hooks_url":"https://api.github.com/repos/iirob/python-opcua/hooks","issue_events_url":"https://api.github.com/repos/iirob/python-opcua/issues/events{/number}","events_url":"https://api.github.com/repos/iirob/python-opcua/events","assignees_url":"https://api.github.com/repos/iirob/python-opcua/assignees{/user}","branches_url":"https://api.github.com/repos/iirob/python-opcua/branches{/branch}","tags_url":"https://api.github.com/repos/iirob/python-opcua/tags","blobs_url":"https://api.github.com/repos/iirob/python-opcua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/iirob/python-opcua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/iirob/python-opcua/git/refs{/sha}","trees_url":"https://api.github.com/repos/iirob/python-opcua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/iirob/python-opcua/statuses/{sha}","languages_url":"https://api.github.com/repos/iirob/python-opcua/languages","stargazers_url":"https://api.github.com/repos/iirob/python-opcua/stargazers","contributors_url":"https://api.github.com/repos/iirob/python-opcua/contributors","subscribers_url":"https://api.github.com/repos/iirob/python-opcua/subscribers","subscription_url":"https://api.github.com/repos/iirob/python-opcua/subscription","commits_url":"https://api.github.com/repos/iirob/python-opcua/commits{/sha}","git_commits_url":"https://api.github.com/repos/iirob/python-opcua/git/commits{/sha}","comments_url":"https://api.github.com/repos/iirob/python-opcua/comments{/number}","issue_comment_url":"https://api.github.com/repos/iirob/python-opcua/issues/comments{/number}","contents_url":"https://api.github.com/repos/iirob/python-opcua/contents/{+path}","compare_url":"https://api.github.com/repos/iirob/python-opcua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/iirob/python-opcua/merges","archive_url":"https://api.github.com/repos/iirob/python-opcua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/iirob/python-opcua/downloads","issues_url":"https://api.github.com/repos/iirob/python-opcua/issues{/number}","pulls_url":"https://api.github.com/repos/iirob/python-opcua/pulls{/number}","milestones_url":"https://api.github.com/repos/iirob/python-opcua/milestones{/number}","notifications_url":"https://api.github.com/repos/iirob/python-opcua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/iirob/python-opcua/labels{/name}","releases_url":"https://api.github.com/repos/iirob/python-opcua/releases{/id}","created_at":"2015-06-18T08:37:42Z","updated_at":"2016-01-16T15:32:27Z","pushed_at":"2016-01-16T22:04:18Z","git_url":"git://github.com/iirob/python-opcua.git","ssh_url":"git@github.com:iirob/python-opcua.git","clone_url":"https://github.com/iirob/python-opcua.git","svn_url":"https://github.com/iirob/python-opcua","homepage":"","size":2400,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"FreeOpcUa:master","ref":"master","sha":"2374dd329252d3178a0996650a57a72af1da0f94","user":{"login":"FreeOpcUa","id":7480453,"avatar_url":"https://avatars.githubusercontent.com/u/7480453?v=3","gravatar_id":"","url":"https://api.github.com/users/FreeOpcUa","html_url":"https://github.com/FreeOpcUa","followers_url":"https://api.github.com/users/FreeOpcUa/followers","following_url":"https://api.github.com/users/FreeOpcUa/following{/other_user}","gists_url":"https://api.github.com/users/FreeOpcUa/gists{/gist_id}","starred_url":"https://api.github.com/users/FreeOpcUa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FreeOpcUa/subscriptions","organizations_url":"https://api.github.com/users/FreeOpcUa/orgs","repos_url":"https://api.github.com/users/FreeOpcUa/repos","events_url":"https://api.github.com/users/FreeOpcUa/events{/privacy}","received_events_url":"https://api.github.com/users/FreeOpcUa/received_events","type":"Organization","site_admin":false},"repo":{"id":31074280,"name":"python-opcua","full_name":"FreeOpcUa/python-opcua","owner":{"login":"FreeOpcUa","id":7480453,"avatar_url":"https://avatars.githubusercontent.com/u/7480453?v=3","gravatar_id":"","url":"https://api.github.com/users/FreeOpcUa","html_url":"https://github.com/FreeOpcUa","followers_url":"https://api.github.com/users/FreeOpcUa/followers","following_url":"https://api.github.com/users/FreeOpcUa/following{/other_user}","gists_url":"https://api.github.com/users/FreeOpcUa/gists{/gist_id}","starred_url":"https://api.github.com/users/FreeOpcUa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FreeOpcUa/subscriptions","organizations_url":"https://api.github.com/users/FreeOpcUa/orgs","repos_url":"https://api.github.com/users/FreeOpcUa/repos","events_url":"https://api.github.com/users/FreeOpcUa/events{/privacy}","received_events_url":"https://api.github.com/users/FreeOpcUa/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FreeOpcUa/python-opcua","description":"LGPL Pure Python OPC-UA Client and Server","fork":false,"url":"https://api.github.com/repos/FreeOpcUa/python-opcua","forks_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/forks","keys_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/teams","hooks_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/hooks","issue_events_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/events{/number}","events_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/events","assignees_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/assignees{/user}","branches_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/branches{/branch}","tags_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/tags","blobs_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/git/refs{/sha}","trees_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/statuses/{sha}","languages_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/languages","stargazers_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/stargazers","contributors_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/contributors","subscribers_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/subscribers","subscription_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/subscription","commits_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/commits{/sha}","git_commits_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/git/commits{/sha}","comments_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/comments{/number}","issue_comment_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/comments{/number}","contents_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/contents/{+path}","compare_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/merges","archive_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/downloads","issues_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues{/number}","pulls_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls{/number}","milestones_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/milestones{/number}","notifications_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/labels{/name}","releases_url":"https://api.github.com/repos/FreeOpcUa/python-opcua/releases{/id}","created_at":"2015-02-20T16:46:53Z","updated_at":"2016-01-13T14:03:45Z","pushed_at":"2016-01-16T22:04:19Z","git_url":"git://github.com/FreeOpcUa/python-opcua.git","ssh_url":"git@github.com:FreeOpcUa/python-opcua.git","clone_url":"https://github.com/FreeOpcUa/python-opcua.git","svn_url":"https://github.com/FreeOpcUa/python-opcua","homepage":"http://freeopcua.github.io/","size":2580,"stargazers_count":40,"watchers_count":40,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":21,"mirror_url":null,"open_issues_count":10,"forks":21,"open_issues":10,"watchers":40,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/114"},"html":{"href":"https://github.com/FreeOpcUa/python-opcua/pull/114"},"issue":{"href":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/114"},"comments":{"href":"https://api.github.com/repos/FreeOpcUa/python-opcua/issues/114/comments"},"review_comments":{"href":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/114/comments"},"review_comment":{"href":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FreeOpcUa/python-opcua/pulls/114/commits"},"statuses":{"href":"https://api.github.com/repos/FreeOpcUa/python-opcua/statuses/25c6deae2fc01fd97a09489db550b9f56bb445d7"}}}}