I want to change authentication of an existing project but I can't change it. Because, I couldn't find the "Change Authentication" button which exists during new project setup. Please tell me, how can I change authentication of existing project?
I think you cannot change that via a push off a button.
Perhaps compare two sample projects with the existing and desired authentication?!?
Related
We are managing a large group of developers that are developing a variety kinds of projects that use Team Foundation Server , We need to restrict some of the developers permissions and just give them to admins .
In the first place, Add solution to source control should be claimed from developers and it should be available for administrators , they should just be able to have check in and check out permission.
I red following document from Microsoft but couldn't how to set such a permission.
Manage Tfs Project
Update:
What we want to do : developers should fill an application and describe about their new projects they want to be added to source controller and then we make a blank solution and add it to source control, Now developers can add their projects to blank solution and check in their changes.
Hope someone could help me here or refer me to a useful document
I appreciate your attention.
developers can add their projects to blank solution and check in their changes and administrators can click the button Add solution to source control to add the solution, right?
If we want to add the solution to TFS Repos, the steps are: Add your solution to version control->Add a comment and check in the solution, then we could see the solution in TFS
The button Add solution to source control just add the project to mapping folder instead of TFS repo, we could not configure the TFS permission to restrict adding solution to source control.
If we need to restrict check-in permission, we could set the repo or repo folder permission. Check the pic below.
In our organization we use TFS 2018 and Visual Studio 2017 Enterprise.
As far as I got until now, there is a way "client-side", configuring from Visual Studio, selecting Team\Team Project Settings\Source Control\Check-in Policy\Code Analysis and I should the custom ruleset defined.
I need two things:
Set a custom guideline that is mix of both default Microsoft ones and other tools' guidelines, like Roslynator or StyleCop.
Create a custom policy server side in order to prevent check-in from Visual Studio (or whatever client we can think of) if code is not compliant to those guidelines.
For the first point, I'll make a clear simple example.
There are the guidelines embedded in Visual Studio.
But they are not complete and I would like to extend them, taking stuff here and there or defining new ones from scratch.
I want to use e.g.:
CA1500: Variable names should not match field names (from default Visual Studio Managed Binary Analysis)
RCS1145: Remove redundant 'as' operator (from Roslynator)
RCS1204 Use EventArgs.Empty (from Roslynator)
SA1302: InterfaceNamesMustBeginWithI (from StyleCop)
SA1305: FieldNamesMustNotUseHungarianNotation (from StyleCop)
How can I do it? And can i do it without make me define it at project level (like incorporating stylecop file for every .csprj) but more at least at solution or Team Project level?
For the second point, I already defined the compulsory comment and compulsory work item attached.
And I can even define new policies, it's true, but they can all be overridden client side.
Is it possible to prevent that?
The best solution for this is two part:
Educate your users to configure the right policies and editor settings. Creating custom project templates and distributing those can help (or deploying a custom build target onto the machine which enforces good defaults.. Having a good local policy will help people do the right thing and people who are supported to do the right thing will likely not try to get around that.
Setup a CI build for your projects. VSTS and TFS have a nice feature which will run a build whenever code is changed. You can even set it up as a Gated Checkin build which will check the sources before they're checked in. This check happens on the server and is much harder to by-pass. You can also configure the build to always override the code analysis settings, even if they're not configured in the project. My MsBuild Helper tasks will help you setup the right MsBuild properties to do that.
As to your more specific questions:
You cannot setup Code Analysis Rules at the Team Project level without also configuring the ruleset for all Visual Studio Projects. Otherwise the checkin policy will cause the check-in to fail, but the developer will then still have to update all projects in the solution with the right ruleset.
You cannot prevent people from by-passing the local check-in policy. The best you can do is to use Reporting Services and Alerts to detect the breach of policy and take corrective action.
You could add the Rule Set into TFS source control and then select it from Code Analysis Policy Editor. Check the screenshot below:
Check-in policy is already applied to a team project, not a single project.
To edit check-in policy, you must have the Edit project-level information permission. You could deny this permission for the users to prevent them from editing the check-in policy.
I've got an MVC project, and I want to add Identity to it, but I can't seem to find any good articles on how to do so.
Is there an easy way to add Identity to an existing project?
I already have a database with stuff in it
Well, in one respect, you simply have to add the Nuget package and start writing code with it, but I think you're probably talking about all the extras: the pre-written code and samples for doing things like password resets, two-factor auth, etc.
For that, no, there's not really an easy way, at least in the sense of click a button and go. What I would recommend is creating a new MVC 5 project with Individual Auth, and then adding the Identity Samples Nuget package to it. Then, open your existing project in another Visual Studio window and copy/paste or use the sample code as a guide for writing your own.
Here's a tutorial that I followed for adding ASP.Net Identity to an existing project. It's up to date and from a reputed source at the asp.net/identity site.
I will echo what Chris said. there is no "easy way" . here is a video link featuring Scott Allen (a pioneer in web dev (Video link)
You can check his other videos as well
I think the easiest way to do that is to do the following steps:
Install All Identity Packages from nugets to your existing MVC project.
Create New MVC Project and choose Authentication type: Individual Authentication.
Copy IdentityModels.cs and all related files including (controllers, views and IdentityConfig) from New project to an existing MVC project.
Add migration to create required tables on database.
I'm getting back there because I ran into this situation some time back and applied solutions from here.
In the meantime I found something simpler.
VS has you covered to actually scaffold the files.
Right-click the project ► Add ► New Scaffolded Item...
Then in the new dialog, select Identity and click Add.
On the next screen you'll be given a list of items to check. You don't need to but you can import all of them if you want. It will ask for the data context but there's not in my case. In yours it should be already filled.
Click Add, you're done.
Is it possible to add an existing project to a solution in "read-only" mode?
I got access to a big bunch of internal projects, from which I just need some functions for another solution. Since I'm new to the original solution I'd like to make sure I don't accidentally change any of the existing files and check them into the TFS.
The easiest way to do so, would be some sort of "Add existing project (read only)"-Function.
Is there any way to do so? Or are there any other ways to ensure I'm not accidentally changing any of the existing files?
I'm using MS Visual Studio 2013 Professional.
Copy the source controled version to a seperate folder, and then reference that one from you Solution. your not working with source controlled code then , so you can't break it!
We use visualstudio.com hosted TFS service.
I need to add a QA / tester to our TFS account, but I do not want them to have any access to our code. Simply just access to the GUI to report bugs, nothing more.
Any tips? Right now I believe when I add the user to the project, they can access our code.
You can secure the "Code" separately from the Work Items by going to the "Code" tab and selecting the dropdown next to the project name and selecting Security.