با سلام
من می خوام یک اجازه دستررسی داشته باشم که کاربرانش فقط بتونند اطلاعات موجود را ویرایش کنند و جدید نتوانند وارد کنند
Printable View
با سلام
من می خوام یک اجازه دستررسی داشته باشم که کاربرانش فقط بتونند اطلاعات موجود را ویرایش کنند و جدید نتوانند وارد کنند
یکم درخواسست غیر عادیه
میتونی یه workflow بنویسی که دفعه اول نام فایل رو در یه فیلد مخفی ذخیره کنه و دفعه بعدی که فایل ویرایش میشه بره چک کنه اگه همون نبود نام فایل رو با مقدار قبلی جایگزین کنه. این بهتره
maybe help:
[LEFT][code][B]How to: Creating a Custom Permission Level [/B]
In my [URL="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/04/02/how-to-assign-a-permission-level-to-a-sharepoint-group.aspx"]last post[/URL], I talked about how to assign a permission level to a SharePoint group.
However, you may want to create your own custom permission level to suit your needs.
For example, you may want a permission that allows used to add, edit, and view items, but not delete them.
To create a custom permission level, first remember that it is the SPRoleDefinition class that we will use.
You then just need to get a reference to the site you want to add the permission level to and then use the default constructor. Take a look at the code below.
[COLOR=black][FONT=courier new] [COLOR=blue]using[/COLOR] ([COLOR=#2b91af]SPWeb[/COLOR] currentSite = [COLOR=#2b91af]SPContext[/COLOR].Current.Site.RootWeb)
{
[COLOR=green]// create a new role definition and set base permissions[/COLOR]
[COLOR=#2b91af]SPRoleDefinition[/COLOR] roleDefinition = [COLOR=blue]new[/COLOR] [COLOR=#2b91af]SPRoleDefinition[/COLOR]()
{
Name = [COLOR=#a31515]"Custom Permission Level"[/COLOR],
BasePermissions = [COLOR=#2b91af]SPBasePermissions[/COLOR].AddListItems | [COLOR=#2b91af]SPBasePermissions[/COLOR].OpenItems |
[COLOR=#2b91af]SPBasePermissions[/COLOR].ViewListItems | [COLOR=#2b91af]SPBasePermissions[/COLOR].EditListItems
};
[COLOR=green]// add the role definition[/COLOR]
currentSite.RoleDefinitions.Add(roleDefinition);
}
[/FONT][/COLOR]
After using the default constructor, I am using property initializers to set the name of the permission level and the rights. The [B]BasePermissions[/B] property is an enum of type [I]SPBasePermissions[/I].
This enum uses a flag attribute, so you simply add permissions using a pipe delimiter.
You can assign them manually like this or in my case I read the value out of an XML file as a ulong and cast it to the type of the enum. Once you have everything set on your role definition, add it to your site using the [B]RoleDefinitions[/B] collection on the SPWeb object.
Deleting a permission level is also pretty easy.
Just call the delete method with the name of the permission level.
[COLOR=black][FONT=courier new] currentSite.RoleDefinitions.Delete([COLOR=#a31515]"Custom Permission Level"[/COLOR]);
[/FONT][/COLOR]
Published [URL="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/04/07/how-to-creating-a-custom-permission-level.aspx"]Apr 07 2008, 12:53 PM[/URL] by [URL="http://www.dotnetmafia.com/members/CoreyRoth.aspx"]CoreyRoth[/URL][/code][/LEFT]
ref:[URL="http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2008/04/07/how-to-creating-a-custom-permission-level.aspx"]How to: Creating a Custom Permission Level - Corey Roth[/URL]
این امکان در Sharepoint 2007 از طریق روش زیر امکان پذیر است1- Site Action>Site Setting و سپس از بخش Users and Permissions گزینه Advanced permissions را انتخاب کنید.2- از منوی Setting گزینه Permission Levels را انتخاب کنید.3- بر روی Add a Permission Level را کلیک کنید.4- یک نام برای سطح دسترسی انتخاب کنید. و گزینه زیر را فقط تیک بزنید. به طور مثال (OnlyEdied)Edit Items - Edit items in lists, edit documents in document libraries, edit Web discussion comments in documents, and customize Web Part Pages in document libraries. 5 - بر روی دکمه Create کلیک کنید.6- حالا در بخش Permission هر لیست و یا هر بخش دیگر زمان اضافه نمودن کاربر و یا گروه از بخش Give Permission گزینه OnlyEdited را انتخاب کنید.کاربر انتخاب شده صرفا امکان Edit را دارد نه اضافه کردن.