ADO.NET :: LINQ To SQL And User Permissions?

Aug 18, 2010

Can I use LINQ to SQL and have a user log in, and with that login be restricted to certain parts of the database.. basically having access to information located under their particular customer ID number.... how would I get the 'session' to follow them throughout the website without having to login each time the database is tapped for info...?

View 1 Replies


Similar Messages:

C# - IIS Virtual Folders Permissions Per User Account?

Aug 10, 2010

I have a website with the below structure for saving product images:

~/fileserver/{user_id}/{file_id}.{file_extension}


I want to restrict access to each {user_id} folder and let only the specific user to retrieve that image. How this can be done? Do I have to set something in IIS?

View 1 Replies

User Permissions On Certain Views Based On Roles?

Feb 23, 2011

I am using ASP.NET MVC 3. We assign roles to certain people at work, then we use Windows authentication to determine what roles a user has. Lets say the roles are RoleA, RoleB and RoleC. So now I get a list of roles for a user. Lets says that UserA belongs to RoleA and RoleB. Some of my views need to be authenticated as not everyone can view certain views. Lets say that ViewA can only be viewed by users that belong to roles RoleA and RoleB. How would I do this? What would I need to look into? When a user that does not belong to these roles tries to access the views then he/she should be redirected to an error page.

View 1 Replies

Configuration :: The Permissions Granted To User 'XXXX'are Insufficient?

Oct 21, 2010

i am able to deploy the SRS Reports locally without any issue. but the probelm when i try to access in the website its gives the error as "The permissions granted to user 'XXXASPNET' are insufficient for performing this operation. (rsAccessDenied)"So Please any one of you let me know what needs to be done in the configuration setting for the problem to get resolved.

View 1 Replies

MVC 2 Technique To Hide A Part Of A View Based On User Permissions?

Aug 30, 2010

What's the best technique to hide part of a view depending of the credentials of the user?

To explain my self little better and as example i have the following code in my view:

<%= this.Model.Name %> <%=Html.ActionLink("Edit",....)%>

And i would like to hide the edit button for those that aren't administrators for instance...

Could you give me a hand?

View 2 Replies

Security :: Impersonation Error / .NET User Account Has To Be Given Permissions To Access The Folder

Jun 18, 2010

I wrote an asp.net application that I'm trying to run on a godaddy domain I bought. I need to read a file in a folder that I did not give read access to so that your average user cannot see in the informaion in that folder. I assumed that the asp.net program would have the same credentials as myself because server-side code. Turns out I am wrong. When I go to use the asp.net application it throws an access denied error saying that the ASP.NET user account has to be given permissions to access the folder.

After talking to two different tech support people at godaddy I've come to the realization that they are either dumb or lazy (or a combo of the two).I came across some code that you can put into the web.config file that would allow the asp.net application to impersonate a user, which would work great to use myself as the impersonated user. However it seems that godaddy cannot give me the name of the server that my domain is on (that's understandable) so I don't know what to put in the identity tag to get this to work.

Here is the code I found:

[Code]....

(of course I filled in the username and password with the correct info)

When I went to use it again it threw this error:

System.Web.HttpException: The current identity (PHX3username) does not have write access to 'C:WindowsMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files'.

View 3 Replies

SQL Reporting :: In Reporting Services Got This Error "The Permissions Granted To User SysnameASPNET Are Insuffic?

Nov 2, 2010

i'm using sql server 2008 with advance services the below error is of reporting services.."The permissions granted to user 'sysnameASPNET' are insufficient for performing this operation. (rsAccessDenied)"when i'm trying to host appliction.. the above error is occured..it works fine when i try to execute locally.. but when i try to execute through the IIS i.e host applicationthe above error is displayed.

View 2 Replies

LINQ Query Based On User Preferences?

May 12, 2010

I have a LINQ Query that includes an order by that is based on a user preference. The user can decide if they would like the results ordered asc or desc.

[code]....

View 2 Replies

MVC :: How To Include The Login User Id In LINQ Query

Dec 24, 2010

I have the following LINQ query inside my models/article class, but i am facing problem in add the current user id in the where statment, as i need to only display the artciles created by the login user, i tried using ; embership.GetUser().ProviderUserKey & ToInt32(Membership.GetUser().ProviderUserKey) , but all failed, either becuase the error indicates that i can not inheret the Memebership class , or because i can not convert object to integer:-

return from userarticle in db.Articles

// where userarticle.User_ID = ToInt32(Membership.GetUser().ProviderUserKey)

orderby userarticle.create_date

select userarticle;

so how i can do so , in other words what should i write after the where "userarticle.User_ID =" ?????? . Hint i am using the default login mechanisim provided by the MVC.

View 6 Replies

Error - FormatException Was Unhandled By User Code In Linq?

Apr 7, 2010

Look below this codes throw me : FormatException was unhandled by user code

Codes:

satis.KDV = Decimal.Parse((from o in genSatisctx.Urun where o.ID == UrunID select o.Kdv).ToString()); How can i rewrite linq query?

View 2 Replies

DataSource Controls :: User Specific Connectionstrings And Linq?

Mar 25, 2010

We have a ASP.NET 3.5 application where we want each user to have their own database. Everyone uses the same web application, but the database their data is kept separate from all others. So every customer has his own database. All database structures are identical, so the only thing the application has to do is connect to the right one when the user logs in.

I envision that we look up a connectionstring to their data at the time they log in and set it globally for that session. With Linq, the connection is handled automatically though, in the background, based on the setting in the web.config file. Unlike SQL Server where you set it each time you use it, with Linq it is hidden in the .NET generated class files.

View 1 Replies

ADO.NET :: Linq Search - Dynamic Query Based On User Input?

Jan 12, 2011

I have two text boxes for the user to enter UserName & First Name, both these fields are optional and not mandatory to fill.

once the user presses the Search button, i execute the following query to fetch matching records.

[Code]....

The problem is, in cases where User leaves both the textbox or one of the textbox empty/blank, in that case that particular field should be removed from where clause.

More like if something is entered then search for that particular record otherwise search for all the records.

View 2 Replies

How To Set Folder Permissions With .NET

Feb 15, 2010

Is it possible to use a small .NET page to set folder permissions on some folders on the server where it resides? What is the code or objects that can be used for this? I am on Windows Server 2003.

Basically I want to hit the page with a GET or POST and have it run and check and/or update the permissions on a folder.

View 2 Replies

Set Permissions For Killing Process?

Mar 25, 2011

I am calling example.exe from asp.net web-page. Example.exe contains Process.Kill(), but I am not able to kill that process whenever Ill run example.exe from asp.net web page. I think i need to set some permissions for killing processes. What permissions must a user have to be able to succesffuly execute a rocess.Kill? Note : it is working when I double clicking on (example.exe), means its killing some processes

View 2 Replies

Required Permissions Cannot Be Acquired In 2.0

Aug 31, 2010

I am getting following error on uploading my pages on web server. it working file on my local machineRequired permissions cannot be acquired.
Description:An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

[Code]....

View 2 Replies

Iis - ApplicationPoolIdentity Permissions On Temporary?

Jun 8, 2010

We have a web application that runs on a WIndows Server 2008 64 bits machine. The app's ApplicationPool is running under the ApplicationPoolIdentity and configured for .net 2 and Classic pipeline mode.

This works fine up to the moment that XmlSerialization requires creation of Serializer assemblies where MEF is being used to create a collection of knowntypes.

To remedy this I was hoping that granting the ApplicationPoolIdentity rights to the ASP.Net Temporary Files directory would be enough, but alas..

What I did was the run the following command from a cmd prompt:

icacls "c:windowsmicrosoft.netframework64v2.0.50727Temporary ASP.NET Files" /grant "IIS AppPoolMyAppPool":(M)

Obviously this did not work, otherwise you would not be reading this :)

Strange thing is that whenever I grant the Users or even more specific, the Authenticated Users Group those permissions, it works. What's weird as well (in my eyes) is that before I started granting access the ApplicationPoolIdentity was already a member of IIS_IUSRS which does have Modify rights for the temporary asp files directory.

And now I'm left wondering why this situation requires Modify rights for the Authenticated Users group. I thought it could be because the apppool account was missing additional rights (googling for this returned some results, so I tried those), but granting the ApplicationPoolIdentity modification rights to the WindowsTemp directory and/or the application directory itself did not fix it.

For now we have a workaround, but I hate that I don't know what is exactly going on here, so I was hoping any of you guys could shed some light on this.

View 3 Replies

ASP OleDB Permissions Error

Mar 24, 2011

I'm uploading an Excel file and then reading data using oledb connection in asp.net but I'm getting the following error: The Microsoft Jet database engine cannot open the file ''. It is already opened exclusively by another user, or you need permission to view its data.

Dim ocmd As New OleDbCommand("select * from [Sheet1$]", conn)
Line 12: conn.Open()
Line 13: Dim odr As OleDbDataReader = ocmd.ExecuteReader()
conn.open() line is red highlighted for error.

The excel file is uploaded successfully and present in the folder.

View 1 Replies

Security :: IIS Permissions For New AppPool ID?

Feb 11, 2010

I am doing some testing and want to find out best practice for creating a new user to assign to an appPool. I know that the default ASPNET account, on IIS 6.0, is very low permissions. For experienced folks, what are the bare permissions required to grant this new user? Yes, I am aware that various NTFS rights are required for different operations, such as reading outside of the application path, writing to the NTFS share, etc. I am just looking at a base install.

Dino Esposito wrote in Chapter 15 of Programming Microsoft ASP.NET 2.0 - Core Reference that the following directories would need the respective permissions:

.NET framework root - read/list Temporary ASP.NET folders - full GAC - read Windows System32 - access/read App root - access/read Web site root - scanWhat else would I need to set up beyond this base configuration as far as rights are concerned? If anyone does this regularly, do you have a script to do this automatically?

View 2 Replies

VS 02/03 Required Permissions Cannot Be Acquired

Sep 9, 2011

I've recently installed VS 2003 to work on an existing web project (I already had 2005 and 2008 installed), but I'm getting an annoying problem when I try to run it. I get a browser page with an error message of:

Code:
Required permissions cannot be acquired.It then pinpoints the problem as being in line 198 of my machine.config, which is:

Code:
<add assembly=*/>

I've changed the ASP.Net version to 1.1.4322 in the appropriate places, and other people in the team can run the project happily using an identical machine.config (they used a copy of mine).

View 3 Replies

Web Forms :: Trying To Write A Linq Query That Has Multiple Where Clauses Depening On User Input?

Jan 27, 2010

I have a quick Linq to SQL question. I am trying to write a Linq query that has multiple where clauses depening on user input. What I would intuitively code is:

Dim arrTerms As Array = txtUserInput.Text.Split(" ")
Dim q = From newsitem In db.MyNewsTable _
Where newsitem.Contains(arrTerms) _
Select newsitem
Listview1.DataSource = q
Listview1.Databind()

Unfortunately, though, the "Contains" operattor does not accept an arraylist, or array, or anything but String.

View 1 Replies

Resetting A File's Security Permissions?

Sep 13, 2010

I've got a routine that tries to import files from an import directory, spitting them out to an Error directory if the import fails. The Error directory is shared and users have access permissions to delete files in there, so they can try to fix the problems and then move the files off to the import directory again. I use File.Move to move the files to the Error directory and this is working fine, apart from the permissions - it seems to revert to a default set of permissions, rather than the directory's one, and so the users can't remove the files - how can I reset the permissions on the file to those of their containing directory? I've tried poking around with SetAccessControl and SetAccessRuleProtection but I don't seem to be having any luck?

View 1 Replies

Deploying SQL CE 4 To IIS 7 - Special Permissions Needed

Dec 13, 2010

I have an ASP.NET 4 site that uses the new SQL CE 4 CTP. The site works fine locally (IIS 7.5 on Win7) and fine in Server 2003/IIS 6. It fails when deploying to IIS 7 on Server 2008. The error I get is:

Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))

The interesting thing is if I switch the app pool user from its default user to LocalSystem, everything works great. So clearly there is a permissions problem somewhere.

Long story short, does anyone know what special permissions need to be set when deploying a SQL CE 4 database? (BTW, we have already set r/w access on the db itself and on c:windows emp)

View 2 Replies

IIS7 Folder Permissions For Web Application?

Mar 28, 2010

I am using windows authentication without impersonation on my company's intranet website with IIS7.

Under IIS7, what account is used to access the folder which contains my web app using these settings?

Would it be IIS_IUSRS? Or NETWORK SERVICE? Or another I don't know about?

View 1 Replies

Security :: Permissions Error Running 2.0 App In IIS

Mar 4, 2010

I am having trouble running a commercial ASP.NET application on a client machine. On most client machines this runs as intended, but for one machine I am getting a security exception as follows: Server Error in '/ElasSelfService' Application. Required permissions cannot be acquired. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Security.Policy.PolicyException: Required permissions cannot be acquired. Source Error: An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:

[PolicyException: Required permissions cannot be acquired.]
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Boolean checkExecutionPermission) +7602199
System.Security.SecurityManager.ResolvePolicy(Evidence evidence, PermissionSet reqdPset, PermissionSet optPset, PermissionSet denyPset, PermissionSet& denied, Int32& securitySpecialFlags, Boolean checkExecutionPermission) +57
[FileLoadException: Could not load file or assembly 'Infragistics2.WebUI.UltraWebListbar.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' or one of its dependencies. Failed to grant minimum permission requests. (Exception from
HRESULT: 0x80131417)]
System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +0
System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection) +43
System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +127
System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +142
System.Reflection.Assembly.Load(String assemblyString) +28
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +46
[ConfigurationErrorsException: Could not load file or assembly 'Infragistics2.WebUI.UltraWebListbar.v8.3, Version=8.3.20083.1009, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb' or one of its dependencies. Failed to grant minimum permission requests. (Exception
from HRESULT: 0x80131417)]
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +613
System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +203
System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +105
System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +178
System.Web.Compilation.BuildProvidersCompiler..ctor(VirtualPath configPath, Boolean supportLocalization, String outputAssemblyName) +54
System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) +229
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +261
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) +101
System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +126
System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) +62
System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +33
System.Web.UI.PageHandlerFactory.System.Web.IHttpHandlerFactory2.GetHandler(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +40
System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) +160
System.Web.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +93
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155

The website has a separate application pool defined for it running under the Network Service account. I have checked the settings for the virtual directory for the application but nothing seems wrong. I have tried defining the trust level in web.config to full trust but this does not fix the issue. I have looked into defining the trust level for the application through the machine.config file but I am unsure of how to proceed with this.

View 4 Replies

XBAP App Full Permissions And Still Got Errors?

Aug 16, 2010

We have a small XBAP file upload app that we are having trouble deploying. We were getting security errors when we were pushing this application that we don't get when running in our development environments on our machines. We gave the XBAP app full permissions and still got errors. Then we created a personal certificate and were able to get this to work. But that means we have to load a client side certificate for each and every machine that wants to run this which is ridiculous.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved