@@ -54,7 +54,7 @@ impl Tweet.remove_like {
5454impl Tweet.comment {
5555 current_profile = [root-->(`?Profile)];
5656 comment_node = current_profile[0] +>:Post():+> Comment(content=visitor.content);
57- _.perm_grant (comment_node[0], level="CONNECT" );
57+ grant (comment_node[0], level=ConnectPerm );
5858 self ++> comment_node[0];
5959 report comment_node[0];
6060 }
@@ -89,18 +89,18 @@ impl Comment.delete {
8989impl visit_profile.visit_profile {
9090 visit [-->(`?Profile)] else {
9191 new_profile = here ++> Profile();
92- _.perm_grant (new_profile[0], level="CONNECT" );
92+ grant (new_profile[0], level=ConnectPerm );
9393 visit new_profile;
9494 }
9595 }
9696
9797impl load_user_profiles.load_profiles {
9898 self.profiles: list = [];
9999
100- for user in NodeAnchor.Collection.find({"name": "Profile"} ) {
101- user_node = user.archetype ;
100+ for each_root in allroots( ) {
101+ profile = [each_root --> (`?Profile)][0] ;
102102 self.profiles.append(
103- {"name": user_node .username, "id": jid(user_node )}
103+ {"name": profile .username, "id": jid(profile )}
104104 );
105105 }
106106 }
@@ -112,13 +112,12 @@ impl load_user_profiles.report_profiles {
112112impl create_tweet.tweet {
113113 embedding = vectorizer.fit_transform([self.content]).toarray().tolist();
114114 tweet_node = here +>:Post():+> Tweet(content=self.content, embedding=embedding);
115- _.perm_grant (tweet_node[0], level="CONNECT" );
115+ grant (tweet_node[0], level=ConnectPerm );
116116 report tweet_node;
117117 }
118118
119119impl load_feed.load {
120- visit [->:Post:->];
121- ignore [--> (`?Comment)];
120+ visit [-->(`?Tweet)];
122121 for user_node in [->:Follow:->(`?Profile)] {
123122 visit [user_node-->(`?Tweet)];
124123 }
0 commit comments