Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

SharePoint permissions for a specific group -


i'm trying establish whether specific group has read access particular site collection.

i have been trying day , half feel if have found 3 halves of different solutions!

the code fragments have far are:

using (spsite site = new spsite(this.generateabsoluteuri(modulecode, academicyear))) {     using (spweb web = site.openweb())     {         (int = web.sitegroups.count - 1; >= 0; i--)         {             spgroup group = web.sitegroups[i];              if (regex.ismatch(group.name, thegroupimlookingfor))             { 

but what?!

most of google results tell me roles don't know how tie role group.

please help!

cheers

patrick

to assign permission user (account) or sharepoint group there objects need @ in order. first thing need the security principal want assign role (spuser or spgroup). next thing need actual permission (role) want assign (ex: read, full control etc…). need create sproleassignment object , on constructor pass in spuser or spgroup (security principal) want assign permissions to. need add role definition roledefinitionbindings collection of role assignment object. need add actual role assignment web (site) , update web. below full code lisitng.

// create site contains our list using(spsite osite = new spsite("<<my site url>>")) {     // open web object   using(spweb oweb = osite.openweb())   {      // group want add user     spgroup ogroup = oweb.groups["<<group name>>"];      // role definition want assign ex: full control     sproledefinition orole = oweb.roledefinitions["<< role name>>"];      // create role assignment object     sproleassignment oroleassignment = new sproleassignment(ogroup);      // add role definition role assignemnt.      // assign specific permission security principal role          assignemnt.     oroleassignment.roledefinitionbindings.add(orole);       // need add role assignment web      oweb.roleassignments.add(oroleassignment);      // update web     oweb.update();    } } 

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -