Giving Custom permission - sharepoint

My requirement is that there are 2 parties
1. User (who creates the item)
2.Approvers who approve the item
When the user creates the item then they should see only their created item in the list (This is easily possible)...the approvers should have only read access and they can see all the items ...when i select the option that only person who creates the item can see the item then approvers are not able to see the items...can somebody plz help that how to work with this...maybe i am missing some simple stuff so can anybody just point me out to the solution..
Thanks

Firstly, if you want the Approvers group to be able to approve the item then they need at least the Approver permission assigned to their group, not just read-only (otherwise they can't update the item to mark it as approved).
However, since the requirement is also that users should only see their own items, I believe the only way the Approvers will also still see the items, is if they have Full Control permissions on the list, therefore you need to break permission inheritance at the list level.

Related

Sharepoint 2010 - Access to lists and alerts

I have created a list and added some fields in order to use it as a form.
We have 30 stores in the country and each store has its own login.
Every store need to be able to Create new items in the list and modify ONLY THEIR OWN.
In order to do that, I had used the LIST PARAMETER - ADVANCED - Read only element create by user.
BUT by doing that, I am unable to Create ALERTS!
So basically, I am looking for a way that users can Create a new entry in the list.
They can modify and see ONLY their entries. Using a custom view is not really a security method.
Administrator needs to see all of the entries and be able to modify any as well.
Form1 - User1
Form2 - User2
If Form1 is modified, I want only User1 (and admin) to be alerted.
Thank you very much and ask me if I forgot to mention any required piece of information
You can create a Workflow... configure it to start when the item is modified... then in your Workflow you add 'Send email notification' step...
so it will be started when someone modify it, and will send you an email notification...

SharePoint Permissions

I have a custom workflow. This workflow removes permissions to items when an item is added (example an item is added by a service account and once added those permissions need to be removed from that item). This works as I have the service account 'hard coded' in the custom workflow.
Now I would like to remove this hard coding and when a item is added to a list I would like to iterate through all users that have access to the list item. If a user matches some algorithm then remove that user from the item permissions which will be 0 to many.
The piece I'm stuggling with is how to iterage all users with permission to a SPListItem. Any thoughts on how to accomplish this?
Thanks in advance!
Check out the SPListItem.RoleAssignments property which is a collection of SPRoleAssignment objects. The Member property then represents a specific SPUser or SPGroup object that is assigned specific permissions in respect to the given list item by binding it to a collection of role definitions.
In your case you need to iterate over all available role assignments, inspect those that denote principals (users or groups) matching your criteria and rearrange the role assignments in a way that fits the desired security policy.
I think I just found the answer to this. I can iterate the RoleAssignments collection and perform my check on that. If anyone has another other ideas I'd be curious to hear about them :)
Thanks1

Sharepoint: List Permission custom message

Is it possible to create a custom HTML message when a user does not have access to a specific List instead of showing the user that there are no records?
I don't understand what you mean. If the user doesn't have access to a list, they won't be able to see the list at all.
On the other hand, if you mean that the user DOES have access to the list but items in the list have unique permissions and he does not have rights to any of those items, then the answer is "no." He will see an empty list and there is no easy way to tell him that the list isn't really empty.

does sharepoint have itemwise permissions , just like it has list wise permissions

( Regarding Moss 2007 )
i have created a sharepoint list in which one column is called user assigned - this is a lookup column of type - people and group.
i select the users from active directory to enter this field of the list.
So different items in this list have different users assigned
I have create permissions for this list to be read and write to the users in active directory .
so that when a particular user logs in to the sharepoint website with his credentials. he has read and write access to the list.
Now is there any way available in sharepoint by which the user do not see the whole list when they login to the website . He only sees the items of the list which the user assigned field is him only.
If the permissions are indeed setup right, you only have to go to List Settings, Advanced Settings, Item-Level Permissions and on "Read access: Specify which items users can read" you define their own.
If the users are not the creators of the items, you need to go to List Settings, Views (at the far bottom), modify the All Items View (or w/e you have as default), go to the filter section and add a filter like: "Show items only when the following is true", "Show the items when column" Assigned To is equal to [me]
I've been implementing such solutions for some while. It is possible, but
it takes much work to be done
if used in long term and/or the amount of data is large, this will hit performance
If none of these is a problem for you, then you can:
create code which performs BreakRoleInheritance() on the item, then adds ViewListitems permission for the user in "user assigned" column. You can find example code, for instance, here: http://social.msdn.microsoft.com/Forums/en/sharepointecm/thread/581e456c-db3c-44f1-b958-a824d95a2536 (or search in Google for "SPPrincipal" and "SPRoleAssignment" for more info)
make this code be called whenever the item is added or updated (you have to wait for the "-ed" events, because in the synchronous version of these events you can't change the permissions yet, for instance in "ItemAdding" there is no item created yet). You can achieve this by adding an event handler to the list.

Override SPList.WriteSecurity behaviour?

As MSDN states, then WriteSecurity has 1 of 3 states possible:
1 — All users can modify all items.
2 — Users can modify only items that
they create.
4 — Users cannot modify any list
item.
But if I want behavour nr. 2 plus users can modify items that are assigned to them? Well if I grant a user full permissions (put in owners group) for list, then those can edit any item (not good). So why wouldn't it work by setting item level permission "full control" just for AssignedTo user (good)? I did, but that didn't help - access denied.
I want exactly the functionality as stated in question "Automatically set list item permission, after new item is created", quoting:
Every users (Supervisor and team members) can see any tasks.
Supervisors can edit any tasks
Team members can only edit their own tasks (tasks that were assigned to them, or created by them)
but although answer has been accepted, the solution does not provide a way for users to edit items assigned to them or items created by user.
Help is appreciated, thank You!
Your only way to do this is using Item-Based Permissions. E.g. have a Workflow or Event Handler change the permission on each file/object based on your requirements.
The solution you quote from the other task is simply setting 2 for SPList.WriteSecurity which still doesn't give users the possibility to edit something they have not created, but were assigned to - in this case you will need to give these users permission, e.g. by listening on the "Assigned To" field with an Event Handler (OnItemUpdated) and give the respective person the needed permission.
Furthermore the solution talks about just setting higher permissions for the users who should always be able to edit items (managers), which is a solution, but you do not have the granularity you usually want in situations like these.

Resources