public static string[] GetTarget_OwnerEmailAddresses(TBAccount owningAccount, TBCollaboratingGroup owningGroup)
 {
     if (owningAccount != null)
     {
         return(owningAccount.Emails.CollectionContent.Select(email => email.EmailAddress).ToArray());
     }
     return(owningGroup.Roles.CollectionContent.Where(role => TBCollaboratorRole.HasInitiatorRights(role.Role))
            .Select(role => role.Email.EmailAddress).ToArray());
 }
 private void HandleOwnerRequest(IContainerOwner containerOwner, HttpContext context, string contentPath, string role)
 {
     if (context.Request.RequestType == "POST")
     {
         // Do first post, and then get to the same URL
         if (TBCollaboratorRole.HasCollaboratorRights(role) == false)
         {
             throw new SecurityException("Role '" + role + "' is not authorized to do changing POST requests to web interface");
         }
         HandleOwnerPostRequest(containerOwner, context, contentPath);
     }
     HandleOwnerGetRequest(containerOwner, context, contentPath);
 }
Example #3
0
        public static void SetAllInvitedViewerMembersAsFullCollaborators()
        {
            var accountIDs = TBRAccountRoot.GetAllAccountIDs();

            foreach (var acctID in accountIDs)
            {
                TBRAccountRoot accountRoot = TBRAccountRoot.RetrieveFromDefaultLocation(acctID);
                TBAccount      account     = accountRoot.Account;
                foreach (var grpRole in account.GroupRoleCollection.CollectionContent)
                {
                    if (TBCollaboratorRole.IsRoleStatusValidMember(grpRole.RoleStatus) == false)
                    {
                        grpRole.RoleStatus = TBCollaboratorRole.RoleStatusMemberValue;
                    }
                    if (grpRole.GroupRole == TBCollaboratorRole.ViewerRoleValue)
                    {
                        grpRole.GroupRole = TBCollaboratorRole.CollaboratorRoleValue;
                    }
                }
                account.StoreAccountToRoot();
            }
        }