Tag Info

Hot answers tagged

7

To get claim for All Authenticated Users in PS you need to use: $claim = New-SPClaimsPrincipal -EncodedClaim "c:0(.s|true" for windows users (NT AUTHORITY\authenticated users): $claim = New-SPClaimsPrincipal -EncodedClaim "c:0!.s|windows" and for all forms authenticated users (basic asp.net membership provider) $claim = New-SPClaimsPrincipal ...


4

Check this out: public static bool IsUserInRole(SPUser user, SPWeb web, string roleName) { SPPermissionInfo info = web.GetUserEffectivePermissionInfo(user.LoginName); SPRoleDefinition roleDefinition = web.RoleDefinitions[roleName]; foreach (SPRoleAssignment roleAssignment in info.RoleAssignments) { ...


3

Answer to both of your question is - no, from msdn breaking role inheritance means - "role assignments on the parent object no longer apply to the child object, for example, so that role assignments on a list no longer apply to a list item." So permission granted on the document library (parent object in your case) never overrides the item level permission ...


2

Maybe you can try different approach. You can secure application in page code rather to alter/add web.config file(s). This link is bit old but for general info will be ok: http://msdn.microsoft.com/en-us/library/dd878359(v=office.12).aspx#SecuringAppPages_ValidatingUserPermissions I still have few scars left from my last fight with Sharepoint web.config.


2

Here is a sample code to get the groups in Silverlight app by calling the GetGroupCollectionFromUserAsync method of UserGroup.asmx web service. http://www.innovawiz.com/get-the-sharepoint-groups-a-user-is-part-of-using-sharepoint-object-model


2

The URI for a claim that specifies the role of a Windows user Admin,Manager or A list of all groups that the user is a member of . A claim as a piece of identity information (for example, name, e-mail address, age, or user role). The more claims your application receives, the more you know about your user. To understand more about the claims you need to ...


2

Simple answer of this question is: Farm Administrator is the father and Site Collection administrators the kids. Farm Administrator have full control on SharePoint farm; can create services applications, Web Application, manage quota, deploy solutions, configure the farm level settings, run PowerShell scripts etc. While site collection administrators, only ...


1

Following example shows how to break role inheritance of a list item and give current user Contribute permissions to the item. var siteUrl = '/sites/MySiteCollection'; function breakSecurityInheritanceAddUser() { var clientContext = new SP.ClientContext(siteUrl); var oList = clientContext.get_web().get_lists().getByTitle('MyList'); var itemId ...


1

Have you tried just getting the Group object and passing that in the roleAssignments.Add call in place of the user object? Something like this: var memberGroup = web.get_siteGroups().getByName("Members"); roleAssignments.add(memberGrooup, binding); I know I've done this but don't recall exactly how.


1

In addition to John's - the Prerequisites are only properly installed on Windows Server (2008 or 2012). If however you install SharePoint 2010 on the client (e.g. Windows 7 or Windows 8) you would need to install and configure prerequisites by yourself, and that includes manually downloading and installing them all from web, and configuring your OS by ...


1

Yes its a little confusing, the thing to note is that a folder is really a SPListItem so the permissions are applies at that object. once you have created your role in the appropriate site or web. To be able to use it you need to grab it from the SPWeb.RoleDefinitions collection. You can do something like, you need to add reference to System.Linq for ...


1

Recursion is the answer to this my friend. private StringCollection sc = new StringCollection(); private void CheckPermissionsOnWeb(SPWeb web, string groupName) { foreach (SPGroup group in web.Groups) { if (group.Name == groupName) sc.Add(web.Url); // Or web.Name or whatever your custom logic is } foreach (SPWeb child in ...


1

Hope this helps! public void addPermissionToGroup() { SPSite site = new SPSite("http://mysite:5050/"); SPWeb spWeb = site.OpenWeb(); string permissionName = "Read"; string groupName = "Project Manager"; try { spWeb.AllowUnsafeUpdates = true; SPRoleAssignment roleAssignment = new SPRoleAssignment(spWeb.SiteGroups[groupName]); ...


1

I create one method that works for me. This method must be called within SPSecurity.RunWithElevatedPrivileges method private void CopyRoles(SPListItem source, SPListItem taget) { if (!taget.HasUniqueRoleAssignments) taget.BreakRoleInheritance(false); for (int i = taget.RoleAssignments.Count - 1; i >= 0; i--) ...


1

I ended up with a solution loosely based on the concept of Role Definitions presented here. Here's a brief description of how this was implemented. For every AD Security Group, create an SPGroup, whose sole member is the corresponding directory group. Then, create an SPRoleDefinition for each required page access, e.g., Page_1.aspx - Read, and an ...


1

I've read an article on MSDN, that suggests using SPRoleDefinitions, and verify at Page_PreLoad, for example, if a user has the required roles to access the page, and if not, redirect him to accessdenied.aspx. The same could be done for the actions within each page. However, this solution would require me to drop AD Groups, and store users and ...


1

You are doing everything correctly, and I can confirm that with the proper setup you are able to add roles to SharePoint groups. If you are getting the red underline, then most likely it is an issue with your web.config files: Make sure that the RoleManager web.config entry is in your: Application web.config Central Admin Web.config Secure Token Service ...


1

Why don't you explore possibilities of SharePoint Web services? I think you can reach your goal much easier by using web services then by using Client Object Model. Take a look at UserGroup Web Service and its method UserGroup.GetRoleCollectionFromUser Method. I believe this method to be exactly what are you looking for. Here you can find one example: ...


1

Of course, I have changed ever web.config in the c:\InetPub\wwwroot folder (and subfolders) Actually, starting from SharePoint 2010, they have several additional web.config files in 14 hive. If error is happening under _layouts folder, you will need this web.config: C:\Program Files\Common Files\Microsoft Shared\Web Server ...



Only top voted, non community-wiki answers of a minimum length are eligible