internal void AddRole(string roleName)
        {
            var rolesDocument = GetRolesDocument();

            if (rolesDocument != null && rolesDocument.HasRole(roleName)) return;

            if (rolesDocument == null)
            {
                rolesDocument = new CouchDbRoles();
            }

            var newRoles = new List<string>(rolesDocument.All);
            newRoles.Add(roleName);
            rolesDocument.All = newRoles.ToArray();

            SaveRolesDocument(rolesDocument);
        }
        internal void AddRole(string roleName)
        {
            var rolesDocument = GetRolesDocument();

            if (rolesDocument != null && rolesDocument.HasRole(roleName))
            {
                return;
            }

            if (rolesDocument == null)
            {
                rolesDocument = new CouchDbRoles();
            }

            var newRoles = new List <string>(rolesDocument.All);

            newRoles.Add(roleName);
            rolesDocument.All = newRoles.ToArray();

            SaveRolesDocument(rolesDocument);
        }
 internal void SaveRolesDocument(CouchDbRoles rolesDocument)
 {
     SaveWithId(rolesDocumentId, rolesDocument);
 }
 internal void SaveRolesDocument(CouchDbRoles rolesDocument)
 {
     SaveWithId(rolesDocumentId, rolesDocument);
 }