\documentclass[DIV=13,%
               BCOR=0mm,%
               headinclude=false,%
               footinclude=false,open=any,%
               fontsize=10pt,%
               oneside,%
               paper=a5]%
               {scrbook}



\usepackage[noautomatic]{imakeidx}



\usepackage{microtype}
\usepackage{graphicx}
\usepackage{alltt}
\usepackage{verbatim}
\usepackage[shortlabels]{enumitem}
\usepackage{tabularx}
\usepackage[normalem]{ulem}
\def\hsout{\bgroup \ULdepth=-.55ex \ULset}
% https://tex.stackexchange.com/questions/22410/strikethrough-in-section-title
% Unclear if \protect \hsout is needed. Doesn't looks so
\DeclareRobustCommand{\sout}[1]{\texorpdfstring{\hsout{#1}}{#1}}
\usepackage{wrapfig}

% avoid breakage on multiple <br><br> and avoid the next [] to be eaten
\newcommand*{\forcelinebreak}{\strut\\*{}}

\newcommand*{\hairline}{%
  \bigskip%
  \noindent \hrulefill%
  \bigskip%
}

% reverse indentation for biblio and play

\newenvironment*{amusebiblio}{
  \leftskip=\parindent
  \parindent=-\parindent
  \smallskip
  \indent
}{\smallskip}

\newenvironment*{amuseplay}{
  \leftskip=\parindent
  \parindent=-\parindent
  \smallskip
  \indent
}{\smallskip}

\newcommand*{\Slash}{\slash\hspace{0pt}}


% http://tex.stackexchange.com/questions/3033/forcing-linebreaks-in-url
\PassOptionsToPackage{hyphens}{url}\usepackage[hyperfootnotes=false,hidelinks,breaklinks=true]{hyperref}
\usepackage{bookmark}

\usepackage{fontspec}
\usepackage{polyglossia}
\setmainlanguage{english}
\setmainfont{texgyrepagella-regular.otf}[Script=Latin,%
 Ligatures=TeX,%
 Path=/usr/share/texmf/fonts/opentype/public/tex-gyre/,%
 BoldFont=texgyrepagella-bold.otf,%
 BoldItalicFont=texgyrepagella-bolditalic.otf,%
 ItalicFont=texgyrepagella-italic.otf]
\setmonofont{cmuntt.ttf}[Script=Latin,%
 Ligatures=TeX,%
 Scale=MatchLowercase,%
 Path=/usr/share/fonts/truetype/cmu/,%
 BoldFont=cmuntb.ttf,%
 BoldItalicFont=cmuntx.ttf,%
 ItalicFont=cmunit.ttf]
\setsansfont{cmunss.ttf}[Script=Latin,%
 Ligatures=TeX,%
 Scale=MatchLowercase,%
 Path=/usr/share/fonts/truetype/cmu/,%
 BoldFont=cmunsx.ttf,%
 BoldItalicFont=cmunso.ttf,%
 ItalicFont=cmunsi.ttf]
\newfontfamily\englishfont{texgyrepagella-regular.otf}[Script=Latin,%
 Ligatures=TeX,%
 Path=/usr/share/texmf/fonts/opentype/public/tex-gyre/,%
 BoldFont=texgyrepagella-bold.otf,%
 BoldItalicFont=texgyrepagella-bolditalic.otf,%
 ItalicFont=texgyrepagella-italic.otf]



\renewcommand*{\partpagestyle}{empty}


% global style

\pagestyle{plain}




\usepackage{indentfirst}

% remove the numbering
\setcounter{secnumdepth}{-2}

% remove labels from the captions
\renewcommand*{\captionformat}{}
\renewcommand*{\figureformat}{}
\renewcommand*{\tableformat}{}
\KOMAoption{captions}{belowfigure,nooneline}
\addtokomafont{caption}{\centering}







\deffootnote[3em]{0em}{4em}{\textsuperscript{\thefootnotemark}~}


\addtokomafont{disposition}{\rmfamily}
\addtokomafont{descriptionlabel}{\rmfamily}


\frenchspacing
% avoid vertical glue
\raggedbottom

% this will generate overfull boxes, so we need to set a tolerance
% \pretolerance=1000
% pretolerance is what is accepted for a paragraph without
% hyphenation, so it makes sense to be strict here and let the user
% accept tweak the tolerance instead.
\tolerance=200
% Additional tolerance for bad paragraphs only
\setlength{\emergencystretch}{30pt}

% (try to) forbid widows/orphans
\clubpenalty=10000
\widowpenalty=10000





% given that we said footinclude=false, this should be safe
\setlength{\footskip}{2\baselineskip}

\title{Site modes and user roles}
\date{}
\author{}
\subtitle{}




% https://groups.google.com/d/topic/comp.text.tex/6fYmcVMbSbQ/discussion
\hypersetup{%
pdfencoding=auto,
pdftitle={Site modes and user roles},%
pdfauthor={},%
pdfsubject={},%
pdfkeywords={doc}%
}


\begin{document}






  \begin{titlepage}


  \strut\vskip 2em
  \begin{center}

  {\usekomafont{title}{\huge Site modes and user roles\par}}%
  \vskip 1em
  
  \vskip 2em
  
  \vskip 1.5em



   
   \vfill



  
    \strut\par
  


  \end{center}


     \end{titlepage}
     
     \cleardoublepage



\tableofcontents
% start a new right-handed page

\cleardoublepage



\chapter{Users}


Permissions are global and if the same user can login on different
sites, it will have the same role. If you trust the user on one site,
but not on another, then create another user with a different
username.


If a logged in user update the language, all the sites on the same
instance will use that language for this user.


We define 5 levels of permissions.

\section{root permissions}


The users with root permissions have full access to anything, but most
important, they can create new sites, change settings, add templates,
etc.. The same login works for all the sites. Given that being able to
access the templates means being able to inject code, this role should
be reserved to people that know what they are doing and have a shell
access.


They don't need to belong to a particular site but in this case they
cannot recover the password via mail.

\section{admin permissions}


They can change a subset of site settings (notably, the ones which
don't require restarting the webserver or shell access) in addition to
the librarian permissions (see below). Only a root user can promote an
user to admin. Users they create are always librarians (there is an
item in the user dropdown menu on the navigation bar).

\section{librarian permissions}


Every site can and should have one or more librarians with login. They
are able to access the revisions, approve the texts, etc. Special
pages are always reserved for them.


They can also create fellow librarians which will share the same
privileges. They are peers and they can create peers.


There is an item in the user dropdown menu on the navigation bar for
this purpose.

\section{human permissions}


This is not strictly speaking a role, because no login is required.
Anyway, to access some part of the sites (adding new texts, editing,
the bookbuilder), a prove that the user is a human and not a bot is
required. This is implemented via a question which the human has to
answer. It takes 10 seconds and after that the humanity of the user is
not questioned any more. Also, they should have cookies enabled
(otherwise we can't store a session for them).

\section{robot permissions}


Humans which don't prove to be such and robots can access all the
public part, including reading and download.

\chapter{Modes}


Each site can run in one of these three modes, which differ on the
privileges granted to the humans. Site modes can be set in the admin,
under the General configuration stanza.

\section{private}


Only logged in can access texts and the site.

\section{blog}


This mode restricts access to the text editing to librarians only.
Humans can still use the bookbuilder.

\section{modwiki}


This mode is a "moderated wiki". Humans can add new texts and edit
them, but approvals and publishing is reserved to the librarians.

\section{openwiki}


This mode is an "open wiki". Humans can add new texts, edit them, and
the result is published right away. Revisions are kept in the git, so
it's always possible to revert to a previous one (but could be
complicated and messy). Use at your own risk, but it could make sense
as a private wiki or in a LAN.







% begin final page

\clearpage



% new page for the colophon

\thispagestyle{empty}

\begin{center}





\bigskip
\includegraphics[width=0.25\textwidth]{logo-amw.pdf}
\bigskip

\end{center}

\strut

\vfill

\begin{center}




Site modes and user roles






\bigskip



   

       

       

       

       

       
   



\bigskip
\textbf{amusewiki.org}


\end{center}

% end final page with colophon


\end{document}


% No format ID passed.



