none
如何在插件中设置实体的访问权限 RRS feed

全部回复

  •  SecurityPrincipal principal = new SecurityPrincipal();

    // 赋予读取权限
     principalAccess.AccessMask = AccessRights.ReadAccess;

    2010年3月12日 7:06
  • 这个只是在共享和分派时,使用的访问权限。  

    #region//给用户设置访问权限

    MyCrmService.CrmService mycrmWsl = GetCrmService();
    MyCrmService.SecurityPrincipal principal = new MyCrmService.SecurityPrincipal();
    principal.Type = MyCrmService.SecurityPrincipalType.User;

    // PrincipalId is the Guid of the user to whom access is being granted
    principal.PrincipalId = UserID;

                                                // Create the PrincipalAccess Object
    MyCrmService.PrincipalAccess principalAccess = new MyCrmService.PrincipalAccess();

                                                // Set the PrincipalAccess Object's Properties
                                                principalAccess.Principal = principal;

                                                // Gives the principal access to read
                                                principalAccess.AccessMask = MyCrmService.AccessRights.ReadAccess;

                                                MyCrmService.GrantAccessRequest grant = new MyCrmService.GrantAccessRequest();
                                                grant.PrincipalAccess = principalAccess;


    生命只是一瞬间
    2010年3月15日 7:15