Access Denied when using ExecuteQuery() for a Sharepoint site - sharepoint

clientContext.ExecuteQuery();
All I'm trying to do is to get (not edit) the list of users I'm a specific group from a Sharepoint site for an MVC app. I'm getting an Access Denied error when I run this line as an Admin. But this line runs just fine if I'm added to the Owners group.
I can also view the group lists through the Sharepoint site if I'm under one or the other or both groups via a web browser. It looks like both groups have the exact same permissions, too. What gives?
I'm unable to change anything else from the Sharepoint side as well, so this is not an option.
If it helps, I'm also using this as a tutorial: http://msdn.microsoft.com/en-us/library/ee538244(v=office.14).aspx

If you go to the group through the UI as a user you need to edit the setting that allows other group members to see whos in the group
Navigate to site settings > people and group > click on your Group > on one of the menus like actions theres an option for group settings. In this settings area there are two config sections, One is to do with who can add users to the group and who can see who is in the group. Check these settings are correct.
Cheers
Truez

Related

Why is the Sharepoint Site Owners group missing from Site Permissions?

I have a dev Sharepoint site with unique permissions (and fake users seen below). In the SharePoint manage access blade, the permissions appear as such:
However, when I click through to the Advanced Permissions link just below that, the permissions look as such:
MaksSite Owners is missing in the 2nd listing, though it appears in the first listing. This group appears to be the default Owners group that came with the SharePoint site. It is also missing when queried through the SharePoint REST API (via /sites/MaksSite/_api/web/GetFileByServerRelativeUrl('/sites/MaksSite/path/to/file')/ListItemAllFields/RoleAssignments?$expand=member). Which listing is right, and if it is the first listing, how do I get it to appear, at least with the API?
By default, the Site Owners group is hidden in the list. To make it appear, please take the following steps:
Click List Settings under Settings.
Scroll down to Views, click Detail View.
In Filter section, choose show all items in this view. Then save the view.
The Site Onwers group will appear in the list:
You could try to use the below Rest API:
/_api/web/GetFileByServerRelativeUrl('/sites/michael/Shared%20Documents/Document.docx')/ListItemAllFields/RoleAssignments/groups?$expand=users

User in SharePoint Group get access is required message

I have a SharePoint Site where I created a List and I want to give read and add access to this list only to a limited group of people.
First I created in the SP site the List "ListX"
In the ListX settings I went to list permissions and I stopped inheriting permissions from the site and I created unique permissions
On the site advanced permission settings I created a new permission level "Add and View Only" where I selected the following options:
On the list permissions section
(a) Add Items - Add items to lists and add documents to document libraries
(b) View Items - View items in lists and documents in document libraries
The moment I selected those two options the following options have been automatically selected for me on the site permissions section:
(a) View Pages - View pages in a Web site
(b) Open - Allows users to open a Web site, list, or folder in order to access items inside that container
Then on the site permission I created a SharePoint group "ListX Users" and I gave the permission level "Add and View Only"
Then I added several users in the SP group "ListX Users"
Then I granted permissions on the ListX permissions to the "ListX Users" SP group
However the user gets the message "Sorry you don't have access" when they try to go to the top level of the site so that they can click on the ListX link and they are prompted to request access.
Any idea why that happens and how to give such Add and View access to the ListX only? Thanks
Best (and easiest) imo is to work down. Give them permissions on site level and break inheritance on each library that shouldn't be visible for everyone.
That way the navigation is the easiest and for maintenance has the easiest overview.
I partially solved my issue by adding two more options in the List permissions permission levels of "Add and View Only". See below.
Open Items - View the source of documents with server-side file handlers
View Application Pages - View forms, views, and application pages. Enumerate lists
However in this case the user need to have a direct link to the list and cannot navigate via the site.

How to set permission so user can modify a web part but cannot delete it or access site settings or lists?

I have a demo page for a web part, so I want a permission level where user can modify web parts using tool part but cannot delete it so other users will also be able to see it. And I also don't want them to access site settings and contents.
I think best way is to create target audience rules and compile them. As the rules may either ON security group membership or user profile property values.
In order to learn more check the Overview section in the following link :
https://support.office.com/en-us/article/Target-content-to-specific-audiences-33d84cb6-14ed-4e53-a426-74c38ea32293

How to stop TFS 2012 users from seeing security settings

I created a user and added them to the 'Contributors' group so they can access code and change items. However, I don't want them to see any security settings. As of right now, using just the contributors group they can go to the web access portal and see all the security settings (even though they cannot modify them). I do not want them to see ANY security settings or groups. How do I do this?
I suggest you to create new custom Group TFS and disable permission : View project level information.
he will have this message if he clicks : "TF50309: the following account does not have sufficient ... "

Sharepoint 2010: Move button disappears in site content and structure

I have a sub-site (http://mysite/documentcenter). My user is in Site Collection Administrators, so I can see and click the move button in site content and structure of sub-site.
But the other users, who has contribute access to all documents, can't see the Move button - it completely disappeared, it's not greyed out.
How can I make the move button display for the other users?
I know this question is a bit old but, you need to have the following Permission Level enabled or Move is not available.
Manage Web Site - Grants the ability to perform all administration tasks for the Web site as well as manage content.
I would be very careful assigning this permission though as it adds a whole slew of additional access for the user(s).
Make sure Add and Customize Pages permissions is present. There could be a Deny mask coming in from User Policy from central admin, which can overwrite Site Collection admin permissions.

Resources