Private posts within the user feed - getstream-io

What is the best way to implement private posts in a users feed so that when the user pulls their feed they see all content but followers only see public content?

There is no way to filter activities within a feed once you retrieve them from the Stream API. With this in mind there are a couple of ways you could approach this problem. First you could perform the filtering on your end, but you would have to store all info about private/public activities inside your database. Second you could use multiple feed groups to achieve this behavior, one feed group for writing public activities one for private activities on feed group that follows both public/private (the users feed form this feed group you show to the user) and to other users you show the private feed group.

Related

Setting PermissionModes in Azure CosmosDB

Hi I working on a simple application using Azure CosmosDB. Now I want to use resource tokens to provide specific access to documents and collection in the DB. In the permission modes there are PermissionMode.Read and PermisssionMode.All. So I am assuming that PermissionMode.All allows the users to read, write, delete and post. If what I am assuming is correct, I specifically do not want my users to delete or post in a certain collection. How do I achieve this?
For better understanding, my database contains a container called users, which contains user information along with their posts and likes per post and stuff. Now I allow all my users to read (view posts of other users) and write (give a like or increment the like field), but I want to allow Post and Delete to a document to only the user of the document.
The finest granularity for assigning permissions is a partition key value so the only way to grant per document permissions is if your document id is also the partition key. If your partition key is userId and the user profile and posts, etc. all share that same partition key then that should work for you. Here is a sample that creates a permission on a partition key for a user.

How do I create multiple activity feeds using the same appid and key?

We allow our creators to create their own site, so how do we get one feed per site?
How do we create multiple react activity feeds using one single getsteam app?
One simple way to do this is to adopt a naming convention to your feed and include some namespacing.
For instance, you could make feed IDs include the name or the ID of the application:
ie. timeline:${app.id}-${user.id} would be the timeline feed ID for app's user.

GetStream and activity feeds

I have an existing notification feed, but I'm looking at possibly migrating over to GetStream.
Currently, I'm using Laravel Notifications, to notify users and other objects.
I currently have something like the following:
1) Users
2) Groups
3) Group Members
So, when I CRUD a group, I simply notify all members of the group and also the group ($group->notifications returns a collection), which works fine.
Looking through the GetStream docs though, it seems there is a concept of 'followers'.
Does this mean, that all members of a group need to be followers of each other to see all notifications?
What about other objects, like, retrieving a feed for a Group? Do i need another Group Type in the dashboard to save activities to?
So, If I Person A and Person B are members of Group 1, When Person A saves Group 1, I'd like Person A, to see something like:
You saved Group 1
and Person B will see:
Person A saved Group 1
When I view the Group page, I'd like to pull in the activities that have happened to that Group.
Is this possible?
Thanks
Does this mean, that all members of a group need to be followers of each other to see all notifications?
Probably not. Stream allows you setup feed groups, following relationships, and use "targeting" to send activities to different feeds.
Based on the use case you described, you're probably best off with two Feed Groups, e.g. group and user_timeline. You can give each user their own user timeline feed and set it to follow other group feeds as appropriate.
When a user does something involving the group, an activity can be added to the group feed. This activity then propagates out to all users who follow the group.
What about other objects, like, retrieving a feed for a Group? Do i need another Group Type in the dashboard to save activities to?
You can always create multiple feed groups for a given app. The example with two groups is probably sufficient for your use case but you could go further with 3 groups...
user: User events posted to this feed. This feed will handle specific and non-group specific activities. If the activity relates to a group, the "to" field can be populated with the group feed name and this will cause the activities to be copied to that feed (and in turn propagated to it's followers).
user_timeline: Retrieved by users. Follows group feeds. User's may also follow another user's user_timeline feed in order to receive all events by that user (e.g. an asymmetrical follow like Twitter / or symmetrical follow like Facebook)
group: Receives user generated activities via the 'to' targetting. System/admin generated activities may also be add directly to the feed.

get stream list of all users in nodeJS

i'm using the javascript getstream integration library: https://github.com/GetStream/stream-js.
I've configured a user feed on my getstream dashboard, suppose i add few users as user:test1 user:test2 user:test3. Is there any way that i can get list of all users that are registered on the user feed group.
Similarly i want this to work for news updates posted by user, where he can see list of users and can follow them.
It is currently not possible to list all the feeds created on a certain feed group via API. You are responsible to store the users of your application within your own backend.

How do I retrieve the users of a specific group or data store through OpenAm 11 SOAP (or REST) web-services?

I have the following requirement: Retrieve the users from OpenAm which are members of a specific group. Alternatively, if possible, retrieve users defined in a specific data store. All this through web-services.
We have our own JDBC data store implementation which reads users from and authenticates users against our database. That works fine. The data store is one of two data stores in our sub realm. The other data store points to an LDAP.
Now I need to read the users (and later the user attributes) from users being defined in the LDAP data store, and only users of a specific group, if possible.
Previously we did that with wso2. There they had a web-service method that allowed you to retrieve users of a specific group only.
Currently I am looking into the IdentityServices web-service of OpenAm, and I am able to list all users of my realm, and get the attributes. But for performance reasons, it would be nice to be able to refine the search. Is that possible? Am I looking at the wrong web-service?
Regards,
Sascha

Resources