Search Gerrit changes by user access rights - search

We have a Gerrit with quite a huge namespace and projects environment and every project has different rights in a matter of code-review or workflow voting and submitting. I sometimes create a set of batch changes accross several projects and then I need reviewers to check and submit. Is there any way how to filter the search results to show only the project which the user searching them can review or submit? Currently, I usually send the results just based on the topic, but this approach still shows all the changes to the reviewers even if they don't have rights to review. Any ideas on how to do or workaround this?

This solution is not exactly what you search for but maybe it can help:
You can use the clause visibleto:'USER-or-GROUP' to match only changes that are visible to 'USER' or to anyone who is a member of 'GROUP'.
More info in Gerrit documentation here.

Related

How to allow anyone to join my github team without them having to ask me

Currently I have an GitHub repo that I use for collaboration. I want anyone to be able to join it.
GitHub currently requires users to first find me (there is no form to request) and ask me and then they are mailed an invitation which they then have to accept.
I'm guessing there is an app out there for this but I can't find it.
I'm looking for either an integration that takes a turns a issue comment into a team add, or form the user can request an invite from.
Forking a repo remains the official way to contribute without asking. Then the contributor can make a pull request back to the original repo.
The goal is to "manage" (through PR review) the flow of contribution.
The other alternative would be to add several people owner of an organization team: that way, you would be the only one people would have to ask in order to be collaborators.
If this is an organization that you're trying to add members to, there is already some automation around that.
JazzBand allows anyone to join the organization. Their website uses the same mechanisms as add-to-org to add people to an organization.
Looking at their source code, it appears both use the GitHub API to add members to an organization.
PUT /orgs/:org/memberships/:username
That said, if this is a personal repository, you'll instead want to follow the API to add a collaborator
PUT /repos/:owner/:repo/collaborators/:username
It's likely you could modify either of those projects to fit this need. Cheers!

MS CRM 2011, Views filtered by teams throw error when user is not a member of any team

We have created some views that show activities assigned either to the current user OR any of the user's teams. The filtering was fairly simple:
Related Activity Parties
- Party equals current user
OR
- Party equals current user's teams
This works great if the user is a member of any team that's not the default. However, if the user is not a member of any team, the view throws an ugly error and doesn't show anything. The error log says "user is not a member of any teams".
I've been playing around with filters, and there seem to be alternative ways to get something similar, but nothing is quite exactly the same. If only there was more flexibility to use the OR and AND groupings.
So, has anyone run into similar issues? I'm thinking about editing the view XML directly, because then I can or/and filters freely and I'd be able to get exactly what I want. However, I'm not sure how well that all works and how would it look if you tried to edit the view in CRM after it was changed directly in XML.
I can confirm for you that this is an issue in CRM 2011 (still an issue as of Rollup 14.) Wish I had an easy solution. Lazy way around it is to create a do-nothing team, with no security role assigned, and just put every user in it. This is a work-around, not a solution, but it will make the issue go away. Not 'elegant' but it works.
The alternative, as you suggest in your post, is writing custom FetchXML for each query you need this on but that defeats much of the benefit of the Advanced Find Query tool and makes long term maintenance and administration more difficult.

QuestionAdding a 'Flag as Inappropriate' flag to comments on a SharePoint blog

I am sorry if this has been asked before, but a google search of stackoverflow didn't find anything relevant.
We are about to pilot blogging within our organisation and as part of compliance we require every comment left on a blog to have a link associated with it for users to flag the comment as inappropriate.
My thinking is that this link could simply change the comment's status from approved to pending and possible send an email to the approvers to go and check it.
By default we need comments to not need pre-approval.
Could anyone please explain the different ways of achieving this? Is there a way of achieving this using SharePoint settings (i.e. no code)?
i think you want to have approve/reject only when users flagged/report that comment ..
it is possible to do with sharepoint designer without any code or coding
you should define a workflow that if creator same as modifier approved automatically and when someone edit or flagged as blob ... change that item status to suspend and workflow not fired. because that condition is not true. and modifier and creator different people

SharePoint site security: how can I programmatically monitor changes?

I have a case where if a SharePoint site owner decides to break permissions inheritance and directly manage site membership, I'd also like to correspondingly modify view permissions on items in a specific list in the top-level site.
How can I best catch those changes so I know when to apply the appropriate changes to the list items?
I'd like to have some C# code be notified when a site's permissions are changed so I can programmatically modify the appropriate list item permissions.
The best way to do this (unfortunately) is to periodically query all of the sites and check to see if inheritance is disabled. I had a similar problem and used powershell scripting to create a report on site security. If you haven't used Powershell before, don't be intimidated. The syntax is VERY similar to C#.
You can use SharePoint auditing to monitor permission changes. It will track changes down to item level. The downside is that you have to turn this feature on and it will hurt performance somewhat.
As for notification, I don't think auditing tells you about changes. I'm pretty sure you would need to poll the audit log.
There's heaps of information about auditing in this article on MSDN.
Another approach which I think might do a very good job of this is to use the SharePoint ChangeLog. Bascially, this is used by SharePoint during indexing, with the log telling the gatherer exactly what has changed, and what should be indexed during an incremental crawl.
When you have a permission change, then this should be picked up during an incremental crawl. The ChangeLog has specific parameters that can be passed to identify changes to permissions. Take a look here at the SPChangeQuery Class:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spchangequery.aspx
Specifically you can look for ChangeTypes:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spchangetype.aspx
Including:
AssignmentAdd
AssignmentDelete
MemberAdd
MemberDelete
...and more

What's the best way to report errors from a SharePoint workflow?

I have a custom action in a workflow and would like to report an error to the user when something goes wrong. What's the best way of doing that?
UPD: Ideally I would like to put the workflow in the error state and log a message to the workflow log. That doesn't seem possible. What's the closest I can get to it? I want to a reusable solution,something that's easy for users to set up when using my custom action in SharePoint Designer.
Added more details to the question.
#mauro that takes care of storing the error, but how do I display the error to the user in a way which makes sense?
#AdamSane That's seems like a rather fragile solution. It's not a matter of setting this up once on a single site. I need something others can add using SPD.
when you throw the error your error handler can then email the user, or better if the list is massive, add the error state to the workflow item - i think this is default functionality though as the error would be mentioned there.
http://www.sharepointsecurity.com/blog/sharepoint/sharepoint-2007-development/fault-handling-in-sharepoint-workflows/
Personally I would log it to either a log file or the event log depending on the issue. I think storing it using a users permissions would be a bad idea, what happens if that user does not have the correct rights? or worse still they get elevated permissions by browsing the list in explorer view?
The log file would be the best way, that way you rely only on the file system being available - you dont have to worry about trapping errors happening whilst connecting to the database etc.
Mauro
Add the error to a hidden list with that users name. Set the visibility on the list (for users) to only read/write their own values. Then use a custom web part or FlexListViewer to view the contents of that list and display it to the user. Once they acknowledge that error, remove it from the list.
If necessary, you can add a different workflow action on that message list, that says pause for 2 days and then email. Whatever, depending on your requirements.
Otherwise you can have a custom db table that you use for pretty much the same thing, this way sharepoint does most of the work for you.
Update This can be packaged up as a feature and deployed to each site as needed. The strengths of this approach (adding a list item to a list, querying, alerting a user, and emailing a user) are all built into the sharepoint itself. In this case you can focus on your custom logic only, while letting sharepoint focus on the implementation details.
If you need the user to take some action as a result of the error (e.g. retrying the workflow) is it possible to create a task for that user with information on the error and the location of the workflow?

Resources