Change/Edit Page Level Permission SharePoint 2013 - sharepoint-2013

I am working on a SharePoint Site 2013, and I have multiple .aspx pages.
Can you please guide me, how can I restrict a specific page to be viewable by few members only.

If its a site page, go to library where it is stored and change item level permission of page, so that it can be viewed by only few members.
If its an application page, in page load event check current logged in user's permission and group and according show him the page or redirect him to access denied page.

Not sure what you don't want them to see but each list object can have it's own permissions so you can stop inheritance on a specific List.. remove everyone leaving only the site owner, and the group you want to have access.
The Page will should.. but it won't show any contents.

Related

In Sharepoint 2013, how do I hide the content of a List?

I want to restrict users from seeing the content of a list when they navigate to "site/Lists//AllItems.aspx". All I want them to see is the message "There are no items to show in this view of the "" list." I've already checked permissions but everything is set properly. We are not using audience targeting.
Configure the list view to use a filter that returns no result. For example, if the smallest ID in the list is 9, set the filter to show ID equals 8
Such hacks will not prevent savvy users from viewing the data though. Access and permissions should be configured properly. Consider removing user access to that list entirely, so only administrators can see it.
First break permission on your list or library by "Stop Inheriting Permissions"
Go to the list, library, or survey and open it.
Go to the Permissions page using the steps in the previous section.
To break permissions inheritance from the parent, select Stop Inheriting Permissions.
Assign unique permissions in SharePoint 2019, 2016, or 2013 server
You must break inheritance from the parent site before you can grant unique permissions. Once you've broken inheritance using the steps in the section above, follow these steps to grant unique permissions:
Go to the list, library, or survey and open it.
Go to the Permissions page using the steps in the previous section.
Select Grant Permissions on the Permissions tab.
Delete Unique Permissions button
Note: If the list or library is inheriting from the parent, you won't see Grant Permissions.
In the Share... dialog box, make sure Invite people is selected, and then type the names of the people or group you want to grant access to in the Enter names or email addresses... box.
Share dialog box
Add a personal message if you like.
Check or uncheck Share everything in this folder, even items with unique permissions. This will grant or restrict access to items you already set unique permissions for. (This option is only available for folders.)
The permission level granted is set to Edit by default, which means the people you invite can make some changes to the list, library, or survey. If you want to grant a different permission level like Read only, click Show options and change the selection in the Select a permission level box.
An email message will be sent to everyone in the Invite people box. If you don't want this to happen, click Show options, and uncheck Send an email invitation.
When you're done, click Share.
Hope this can solve your issue:
https://support.microsoft.com/en-us/office/customize-permissions-for-a-sharepoint-list-or-library-02d770f3-59eb-4910-a608-5f84cc297782

User without permission can see the list with no items to show instead of Sorry, this site hasn't been shared with you.at shrepoint

At microsoft sharepoint the permission of list is already updated, but user without permission still can see the list at left hand side quick launch, and when enter the link it shown with no items to show instead of Sorry, this site hasn't been shared with you.
Unexpected
Expected
You have probably added the list to a sitepage.
Permissions work differently for sitepages and apps.
If you grant a user permission to view a sitepage you implicitly grant the permission to view any webpart on that sitepage.
If the user does not have permission to view the contents of the app inside of the webpart, the app will display as having no content.
To get the error message you desire when no read permission was granted, you have to share the URL of your list.
Go to you site contents (gear icon top right corner) and click on your list. Now copy the URL from your navigation bar and share it with your users.

How to access page by address in APEX

In the interactive report I developed with Apex, the table on the home page shows the information of a list of projects, including project name, owner etc. And the project name field of each project is a click which redirect to another page that shows more detailed project's information. In short, there is a link on the home page which directs to the page A. Sometimes, I need to copy and paste the address of this page A and send it to my colleagues so that they can go to that page directly by copying the address to their browser. However, when I tried to use the address to view the page, I got redirect to the home page instead of page A. Why this is the case? How can I achieve the redirection I want in APEX?
P.S. My APEX application do have access control where only authorised people can create and edit items in the report, but everyone can view the item and the page A is the viewing page. I am not sure if this access control have anything to do with the issue.
I got the answer from APEX forum, so I am gonna write the answer here so that it might be of some help.
The url has a session id, which belongs to the app. By default, if you copy and paste this address to another browser, a new session will be created and the old id will not be valid anymore and the url will redirect you to the login page or the home page. If you want to make this url valid all the time, you need change the deep link attribute to be enabled under the authentication. Please refer to Deep Linking for more details.

Sitecore requires me to login in order to see my website

When I access my site that's being managed by Sitecore, it's redirecting me and asking for Sitecore credentials. I have no idea why but obviously the main site should be viewable to public without needing creds.
Thanks.
This could be from your sitecore cookie still in page editor mode, To fix this add this query string to your URL:
?sc_mode=normal
This will update your cookie and no reddirect to login anymore
Assuming that you have a combined CM/CD environment and that this is specific to your computer or other authors' computers, it is likely that Sitecore is picking up on the fact that you were using the Page Editor in a previous session. When you are using Page Editor Sitecore will drop a cookie called website#sc_mode and set it to "edit". If you return to the page with that cookie set it will push you to the Login Page as it things you are attempting to edit that page.
To resolve this try clearing your cookies or using a browser in Incognito mode/Private Browsing.
If this is happening to other users I would suggest following Martijn's advice in the other Answer and checking your site definition.
Check your site definitions in the web.config and/or the sites.config in the /app_config/include/ folder. Most of the times there is some misconfiguration there.
Check the security roles set on your site pages. If for some reason access has been denied to the 'extranet/anonymous' user you won't be able to browse without being authenticated.

Excluding list items created by certain users from a list's view

I have a custom list created in Sharepoint 2007 and displayed by a content query web part.
I would like to
Show all items to general admin users except those items created by two users.
The two admin users need to see all items in the list.
The first requirement is easily done by adding a filter to the view on the created by field.
The second one is where I need help, is there a way to set the view of a list based on the user logged in to acheive the second requirement?
Or is this achievable another way?
Many Thanks,
Nav
If user has SPBasePermissions.ManageLists permissions, he will have permissions to view all items in the list.
If its not about permissions, but just which view which user sees by default, then it will involve some sort of coding :
Either you create webpart which will switch to desired view for desired user. (Involves coding, building, deploying)
Use content editor web part to switch with javascript - not that nice solution. (Because page would reload when you open it).
In the end I created two pages one called restricted and the other for all users configured the views on each page for each group of users. Then I restricted access to the 'restricted' page to the relevant users.
I used audiencing to display a link to the 'restricted' page to selected users