문제

I want to check, if user can add document in document library then custom action is enabled. I used this article.

And then I encountered the following problem: I don't know how check user rights of adding for this library.

I try to use SPGroup of current web, but I need to know names of groups, and this names is not constant. I can get roles of current user, but how can get information about what this set of roles contain the role of type SPRoleType.Contributor?

I would be grateful for any attempt to help!

도움이 되었습니까?

해결책

Yeah, I found solution!

bool t = list.Permissions.DoesUserHavePermissions(SPRights.AddListItems) 

Return true if user can add document to library!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top