VSTS: Query based on observing user - azure-devops

I am working on some simple queries for Visual Studio Team Services. Is there a way to change the query result based on which user views it?
I know about the #Me operator but for this specific case I want to look for unassigned work items and filter them by current user.
There are 3 backlogs, and user A,B and C. User A is responsible to assign tasks for backlog1, user B for backlog2. I want to have a single dashboard with a query showing the unassigned task. So if user A opens the dashboard it should show all unassigned tasks for backlog1 and for user B all tasks from backlog2.

Microsoft has recently added the #Me token to all fields related to users.
This enables creating queries for the observing user - and in extension - personalised queries on the dashboard.
Additional info and the related docs can be found here

Related

Azure DevOps, move all work item assignments to new user

I have User A & User B. User B will take over all assigned to work from user A.
Is it possible to migrate all work items, & mentions in pull reques etc from user A to user B?
To migrate all work items from user A to B, you could achieve this by using Boards -> Query.
For migration mentions in Pull Request, currently there is no build-in feature to migrate this.
Run a new query to list all the work items assigned to user A
Choose all the work items and "Right" click to assign to user B.
Then "Save Items"

Prevent users from creating work items more than 5 in azure devops

I want to prevent users from organization to create more than 5 work items in boards in each project. Also want to set a rule as more than 5 tickets if any users wants to create according to business need, we should enable the count.
Is there a way to do this??
Azure DevOps does not support such restrictions. In this case, you have to create your custom application via Rest Api, that rejects or deletes restricted work items:
Search work item: Query By Wiql, use [System.CreatedBy] field in your query
Get work item details (if you need to check some additional fields): Get Work Item
Update state (Update) or remove (Delete) restricted work items.

Restrict User Access to Board from Azure DevOps

As a DevOps administrator I want to give restricted access to the backlog of our project to a user.
I want to limit his access. Meaning that the user can only see Work Items he has created in the backlog, nothing else.
Is their a way of doing this?
the user can only see Work Items he has created in the backlog,
nothing else
I am afraid that this feature you want is not feasible.Boards is visible to all members of your organization.
You can only set the member to Project Readers at most, so that members only have read permissions but no modified permissions.
You can set the Assign to filter condition in the Filter of the backlogs to see the work items assigned to a specific person, but it can't prevent the user from viewing the work items assigned to others. In addition, there is no filter condition to see who created the work items.

I have a MongoDB database and I want only a specific user accessing his private data

I have a MongoDB database, express and angular in the frontend.
I already have AUTH setup in a collection and another collection for storing Data.
Right now users can log in and save data, but the data that they save right now is global, meaning I could come and add 1) Learn MongoDB and the second user when they sign in sees the same thing.
I want users to be able to only see the data that he/she posts.
I have been browsing the internet for this specific tutorial but haven't found anything.
If someone could point me in the right direction and a little introduction on it, it would be very helpful.
At its core, this is very very simple. Say, you have a todo list application. So it has Users and Tasks. So the index page for Tasks has this code now (pseudocode ahead):
tasks = db.tasks.find()
render tasks
Naturally, all users see all tasks. What you need to change is now pass id of the logged-in user to the query:
tasks = db.tasks.find({user_id: current_user.id})
render tasks
That's it, now all users see only their own tasks. Do this for all other kinds of private data.

Restrict the views available to users on the case/incident page

I have a modified CRM 4 application that uses cases as the main enitity. In the application we have a number of teams setup and a number of queues that correspond to each team. I have written a plugin that restricts the queues a user can see depending on whether or not they are a member of the corresponding team (on the retrievemultiple event of queue)
What I would like to know is if it is possible to restrict the views a user has access to when they navigate to the main cases page. I would like to hide the default public view for every user, and for there only to be a set number of views available that correspond to the team that the user belongs to.
Yes, you can register a plugin for the RetrieveMultiple message on the savedquery entity. Then you'll have the QueryExpression used to retrieve the views. Just check that it's for the entity you're trying to filter, then add a few conditions to the query based on what you'd like to hide from the end user (savedquery.name != "View to Hide" or whatever).