.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Which SPBasePermissions required to access sitecollection?

Posted By:      Posted Date: September 08, 2010    Points: 0   Category :SharePoint
I'm not sure if I can describe the problem so that everybody can understand it right away, so please don't hesitate asking questions to narrow down my problem. So to start things off I removed all default user groups (owner, member, visitor) and created new groups e.g. "project lead", "project lead customer" aso. I've created an individuell role for each group and those roles have a custom set of SPBasePermissions to define which kind of actions the user can do. Finally I'm using the following method to combine the role and the group with every list, documentlibrary and SPWeb inside my sitecollection:   public static void EnsureRoleAssignment(this SPSecurableObject securableObject, SPPrincipal principal, SPRoleDefinition roleDefinition) { if (!securableObject.HasUniqueRoleAssignments) { securableObject.BreakRoleInheritance(true); } var pRoleAssignment = new SPRoleAssignment(principal); pRoleAssignment.RoleDefinitionBindings.Add(roleDefinition); securableObject.RoleAssignments.Add(pRoleAssignment); } So here is my problem: If I try to access my site collection or any list with a user which has been added to the "project lead" group I get "Access denied". Which rights are the minimum requirement based on this link ?

View Complete Post

More Related Resource Links

TreeView in Web Part required webctrl_client folder to have atlease read access for all users


HI All

I am using the TreeView control from the Microsoft.Web.UI.WebControls Namespace to render a treeview in a SharePoint web part. The tree nodes images do not appear (text is rendered) properly until i grant atleast read permissions to Authenticated Users on the webctrl_client folder which has to be places in the web application's virtual directory.

Is there some way I can avoid granting the read permission on that folder to all authenticated users.

If i go ahead with the approach of giving the authenticated users rad permission, will a user loggedin via FBA get the read permission

Thanks in Advance

Defining required access rights for a service with ServiceController




I'm pretty sure this is straight forward I just can't seem to get it working.


I have a service called serviceX and I want to control it from another application.  The "control" is simply checking the ServiceController.Status field and calling ServiceController.Start().


The exception i get is:-

System.InvalidOperationException: Cannot open serviceX service on computer '.'. ---> System.ComponentModel.Win32Exception: Access is denied

--- End of inner exception stack trace ---

at System.ServiceProcess.ServiceController.GetServiceHandle(Int32 desiredAccess)

at System.ServiceProcess.ServiceController.Start(String[] args)

at SnippetCompiler.ServiceMonitor.StartService()


In Win32 I would specify SERVICE_QUERY_STATUS and SERVICE_START as the required access in the OpenService API call.  How do I do this in managed code?  I can only assume I need to use a ServiceControllerPermission object but I can't figure out how.



MVC architecture in ASP.Net using C# and Microsoft Data Access Application block

The Model-View-Controller (MVC) pattern separates the modeling of the domain, the presentation, and the actions based on user input into three separate classes [Burbeck92]:

Model. The model manages the behavior and data of the application domain, responds to requests for information about its state (usually from the view), and responds to instructions to change state (usually from the controller).

View. The view manages the display of information.

Controller. The controller interprets the mouse and keyboard inputs from the user, informing the model and/or the view to change as appropriate.

Store and Display Images from MS Access Database Using C#

There is only the difference of coding syntax to stream the binary data of image content type to upload it into MS Access Database using C#/VB in ASP.Net 2.0

Namespaces required:-
using System.Data.OleDb;

OleDb is used to connect the web site forms with MS Access Database using Microsoft.Jet.OLEDB.4.0

ASP.Net Upload Image to MS Access Database

As you learnt from the previous articles to upload image to the SQL Database in ASP.Net 2.0 and stream that image into the memory to retrieve it from the database and display it on the web page. In this article you will learn how to upload images to the MS Access database in ASP.Net 2.0

First of all create an Access Database and place it in the App_Data folder of ASP.Net web site project. Then create a table "tblImg" with the following fields:

Wrong Account being used to access files - Help - No Impersonation


I run a simple .aspx website on a Windows Server 2008 machine.

There is NO impersonation, and System.Security.Principal.WindowsIdentity.GetCurrent().Name returns NT AUTHORITY\NETWORK SERVICE, which it the account which the application pool runs. In my web.config, I have <authentication mode="Forms">.


I tried to test the security of the application and server by removing file permissions to the .aspx files. I was greatly worried when the website continued to run without problem (it should not have been able to read the .aspx files).

By turning on file level auditing, I discovered that the .aspx files were being read by the machine$ account (if the machine is called Serv1, then the files would be read by the Serv1$ account, which seems to have access to all files on the local machine).


Is this a security breach or is this behaviour by design ?

Please can somebody assist, as I am worried.

Disallow Direct Access To Files



Here is my dilema, on my site i have a WordPress Audio player (http://wpaudioplayer.com/standalone) that plays my mp3's.

It loads the Mp3's in by javascript...example below:

       AudioPlayer.embed("audioplayer_7", { soundFile: "/Files/Music/[name of file].mp3" });

This file name is clearly visible in the browser source. Not a problem, however this means that any user can legitimately browse to the file directly and download it.

Now i still need the mp3 player (which is flash) to have access to the file but if a user was to try accessing the file directly, they would not be allowed access to it.

I am not sure how to go about this, i am circling the idea of a httphandler but not sure if this is sufficiant to stop the direct access to the file.

Any help would be appreciated

How to access a new database ( which i created ) in isqlplus ?



I created a new database with the help of Database Configuration Assistant !

I created with the scott account

Now i'm not able to connect to the database with the connect identifier with the scott account

The error i get is.,

ERROR - ORA-12154: TNS:could not resolve the connect identifier specified.

Plz help !

Access SessionState: via App1 to SessionState from App2


Hi .NET'ers,

i'm interested to do the following - i geuss, i have no option to do that:

we have our "mainapplication" on a DB; we are tracking user-login status by switching a bit in the DB in the users data row.

we hvae a second application, the backend, which is the administration tool.

(the applications are put in seperate diretories on HD)

sometimes, we need to block/ban users. in some cases the users are logged in, when we "see them in action".

i'd like to build a button in the backend-application, which logss-out the user from the mainapplication.

for sure: i can access the same DB and switch the bit to "know" he's offline, but this will not kill the session on the mainapplication.

because: if a user is on/offline is also indicated by the session in the IIS.
and as the IIS-session is active, the user may be already banned - but he will not be logged out automatically (and showing something like "you have been logged out because of a ban)

one option would be to call the DB by each page-load to find out, if the user is logged on.

is there any option to implement this?

sql server 2005 enterprise edition is required


sql serve 2005 enterprise edition is required to work with microsoft enterprise blocks


Microsoft Application Block for Data Access in .NET


Hi all,

I was rummaging the internet learning aspx and came across the concept of: Microsoft Application Block for Data Access in .NET

It seems great of course. The articles are all early 2003-5 such as


So the question is - is this tech still relevant and should I be using it?



data access library v4.1


Ive just started a project that will use the enterprise library 4.1 data access code blocks.  Its been years since ive used them, can anyone tell me what assemblies I need to reference in my project in order to use them ?  Ive referenced 


are there any others I need ?

unable to access control inside webuser control



I have used calender web user control inside my project where i took textbox,button and calender.....but after dragging onto my aspx page....i am unable to access this textbox,calender and button on aspx page...Pls help me to find out the solution.

Help with me AD access in Asp.NET + C#


Hi All,


Need a help..

I have deployed a asp.net web application with integrated windows authentication mode on.

The requirement is that.. few menu options will be visible to end user based on their role..So I am getting the loggedin user identity and then checking for group of that user..

I implemented this code and it is working fine. I am getting the list of groups user is associated with.

Recently we decided to give access to the student user group also which is the most restrictive group out of all..

we gave folder read folder permission to application folder and when tried to access the site, it is asking for username, password again and again and some times randomly it gives error:

Computer name could not be obtained.

Can anybodly please help me to understand what is the minimum permissions required to a AD user group to acces a windows authenticated asp.net site?




Using windows authentication to access SQL when using ASP.NET 4.0 via COM+


I am using SQL Server 2008 under windows authentication, front end is ASP.NET which uses COM+ to access database.

COM+ components are configured to run as domain user.

When looking through the logs (SQL Profiler), I can see the login name as the configured identity instead of windows indentity.

I have got Website running under "Intergrated Windows Authentication" and database is running locally on webserver.

Web configure contains entry for <identity impersonate="true"/>.

My connection string is

connectionString="data source=db01\test01;initial catalog=test; integrated security=SSPI;persist security info=False; Trusted_Connection=Yes"

Any ideas?




Export Dataset to excel sheet in a required format?



I know how to export a grid view to excel.

But here i have a Dataset which consists of data like below and also it need to display in a required format like below.

pno psubno pstate pdetailid pdetails

 12    1          CA         1           cbsdjcbdjc     

12     1          CA          2        cndcnjdcjcj

12     2           VA         4          xcndwkfcgygry

13     1            AL        1           ncdcnjdcndj

My excel sheet  should like this.

pid       pstate     

 12/1      CA             &nb

Required permissions cannot be acquired when host asp.net 3.5 application in godaddy


I got the following error when click print report button.

Application : asp.net 3.5

Crystal report : 10.5

Host: godaddy

Please help me.


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.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend