]> git.ipfire.org Git - thirdparty/cups.git/blame - doc/help/policies.html
Update ipp documentation to reflect the behavior of configuring WiFi on IPP USB printers.
[thirdparty/cups.git] / doc / help / policies.html
CommitLineData
8ca02f3c 1<HTML>
2<!-- SECTION: Getting Started -->
3<HEAD>
4 <TITLE>Managing Operation Policies</TITLE>
178cb736 5 <LINK REL="STYLESHEET" TYPE="text/css" HREF="../cups-printable.css">
8ca02f3c 6</HEAD>
7<BODY>
8
178cb736
MS
9<H1 CLASS="title">Managing Operation Policies</H1>
10
68b10830
MS
11<P>Operation policies are the rules used for each IPP operation in CUPS. These rules include things like "user must provide a password", "user must be in the system group", "allow only from the local system", and so forth. Until CUPS 1.2, these rules were largely hardcoded and could only be customized at a very basic level.</P>
12
13<P>CUPS 1.2 and later provides a fine-grained policy layer which allows you to completely redefine the rules for each operation and/or printer. Each policy is named and defines access control rules for each IPP operation. This document describes how to manage policies and their rules.</P>
8ca02f3c 14
15<H2 CLASS="title"><A NAME="BASICS">The Basics</A></H2>
16
37d9646b 17<P>Operation policies are used for all IPP requests sent to the scheduler and are evaluated <em>after</em> the <A HREF="man-cupsd.conf.html#Location"><TT>Location</TT></A> based access control rules. This means that operation policies can only add additional security restrictions to a request, never relax them. Use <TT>Location</TT> based access control rules for server-wide limits and operation policies for limits on individual printers, tasks, or services.</P>
68b10830 18
37d9646b
MS
19<P>Policies are stored in the <VAR>cupsd.conf</VAR> file in <A HREF="man-cupsd.conf.html#Policy"><TT>Policy</TT></A> sections. Each policy has an alphanumeric name that is used to select it. Inside the policy section are one or more <A
20HREF="man-cupsd.conf.html#LimitIPP"><TT>Limit</TT></A> subsections which list the operations that are affected by the rules inside it. <A HREF="#LISTING01">Listing 1</A> shows the default operation policy, appropriately called "default", that is shipped with CUPS.</P>
68b10830 21
37d9646b 22<P>The easiest way to add a policy to the <VAR>cupsd.conf</VAR> file is to use the web interface. Click on the <VAR>Administration</VAR> tab and then the <VAR>Edit Configuration File</VAR> button to edit the current <VAR>cupsd.conf</VAR> file. Click on the <VAR>Save Changes</VAR> button to save the changes and restart the scheduler. If you edit the <VAR>cupsd.conf</VAR> file from the console, make sure to <A HREF="man-cupsd.conf.html">restart the cupsd process</A> before trying to use the new policy.</P>
8ca02f3c 23
5a738aea 24<PRE CLASS="example">
8ca02f3c 25<EM>Listing 1: <A NAME="LISTING01">Default Operation Policy</A></EM>
26
27 1 &lt;Policy default>
28 2 # Job-related operations must be done by the owner or an
355e94dc 29 administrator...
8ca02f3c 30 3 &lt;Limit Send-Document Send-URI Hold-Job Release-Job
31 Restart-Job Purge-Jobs Set-Job-Attributes
32 Create-Job-Subscription Renew-Subscription
33 Cancel-Subscription Get-Notifications Reprocess-Job
34 Cancel-Current-Job Suspend-Current-Job Resume-Job
68b10830 35 CUPS-Move-Job CUPS-Get-Document>
8ca02f3c 36 4 Require user @OWNER @SYSTEM
37 5 Order deny,allow
38 6 &lt;/Limit>
3e7fe0ca 39 7
355e94dc 40 8 # All administration operations require an administrator
8ca02f3c 41 to authenticate...
1d670c39 42 9 &lt;Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class
355e94dc
MS
43 CUPS-Delete-Class CUPS-Set-Default>
4410 AuthType Default
8ca02f3c 4511 Require user @SYSTEM
4612 Order deny,allow
4713 &lt;/Limit>
3e7fe0ca 4814
355e94dc
MS
4915 # All printer operations require a printer operator
50 to authenticate...
5116 &lt;Limit Pause-Printer Resume-Printer
52 Set-Printer-Attributes Enable-Printer Disable-Printer
53 Pause-Printer-After-Current-Job Hold-New-Jobs
54 Release-Held-New-Jobs Deactivate-Printer Activate-Printer
55 Restart-Printer Shutdown-Printer Startup-Printer
56 Promote-Job Schedule-Job-After CUPS-Accept-Jobs
57 CUPS-Reject-Jobs>
5817 AuthType Default
5918 Require user <em>varies by OS</em>
6019 Order deny,allow
6120 &lt;/Limit>
3e7fe0ca 6221
355e94dc 6322 # Only the owner or an administrator can cancel or
8ca02f3c 64 authenticate a job...
355e94dc
MS
6523 &lt;Limit Cancel-Job CUPS-Authenticate-Job>
6624 Require user @OWNER @SYSTEM
6725 Order deny,allow
6826 &lt;/Limit>
3e7fe0ca 6927
355e94dc
MS
7028 &lt;Limit All>
7129 Order deny,allow
7230 &lt;/Limit>
7331 &lt;/Policy>
8ca02f3c 74</PRE>
75
76<H3>The Default CUPS Operation Policy</H3>
77
68b10830 78<P>The policy definition starts with an opening <TT>Policy</TT> directive:</P>
8ca02f3c 79
5a738aea 80<PRE CLASS="example">
8ca02f3c 81 1 &lt;Policy default>
82</PRE>
83
68b10830 84<P>The first <TT>Limit</TT> subsection defines the rules for IPP job operations:</P>
8ca02f3c 85
5a738aea 86<PRE CLASS="example">
8ca02f3c 87 3 &lt;Limit Send-Document Send-URI Hold-Job Release-Job
88 Restart-Job Purge-Jobs Set-Job-Attributes
89 Create-Job-Subscription Renew-Subscription
90 Cancel-Subscription Get-Notifications Reprocess-Job
91 Cancel-Current-Job Suspend-Current-Job Resume-Job
68b10830 92 CUPS-Move-Job CUPS-Get-Document>
8ca02f3c 93 4 Require user @OWNER @SYSTEM
94 5 Order deny,allow
95 6 &lt;/Limit>
96</PRE>
97
68b10830
MS
98<P>The operation names are listed on a single line with spaces separating them. Each name corresponds to the IPP operation described in any of the IETF or PWG standards documents for the Internet Printing Protocol. <A HREF="#TABLE01">Table 1</A> lists all of the operations that have been defined along with their usage in CUPS.</P>
99
00d3a9af 100<P>The access control rules are listed after the <TT>Limit</TT> line and are the same as those used for <A HREF="man-cupsd.conf.html#Location"><TT>Location</TT></A> sections. In this case, we require the owner of the job ("@OWNER") or a member of the <A HREF="man-cups-files.conf.html#SystemGroup"><TT>SystemGroup</TT></A> ("@SYSTEM") to do the operation. Because we do not include an <A HREF="man-cupsd.conf.html#AuthType"><TT>AuthType</TT></A> directive here, the user information can come from the IPP request itself or the authenticated username from the HTTP request. The administrative operations starting on line 9, however, <em>do</em> use the <TT>AuthType</TT> directive, and so administrative operations need to be authenticated:</P>
8ca02f3c 101
5a738aea 102<PRE CLASS="example">
1d670c39 103 9 &lt;Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class
355e94dc
MS
104 CUPS-Delete-Class CUPS-Set-Default>
10510 AuthType Default
10611 Require user @SYSTEM
10712 Order deny,allow
10813 &lt;/Limit>
3e7fe0ca 10914
355e94dc
MS
11015 # All printer operations require a printer operator
111 to authenticate...
11216 &lt;Limit Pause-Printer Resume-Printer
8ca02f3c 113 Set-Printer-Attributes Enable-Printer Disable-Printer
114 Pause-Printer-After-Current-Job Hold-New-Jobs
115 Release-Held-New-Jobs Deactivate-Printer Activate-Printer
116 Restart-Printer Shutdown-Printer Startup-Printer
355e94dc
MS
117 Promote-Job Schedule-Job-After CUPS-Accept-Jobs
118 CUPS-Reject-Jobs>
11917 AuthType Default
12018 Require user <em>varies by OS</em>
12119 Order deny,allow
12220 &lt;/Limit>
8ca02f3c 123</PRE>
124
68b10830 125<P>The "Order deny,allow" line at the end of both <TT>Limit</TT> subsections allows the request to come from any system allowed by the <TT>Location</TT> sections elsewhere in the <VAR>cupsd.conf</VAR> file.</P>
8ca02f3c 126
68b10830 127<P>The <TT>Cancel-Job</TT> and <TT>CUPS-Authenticate-Job</TT> operations are listed separately to allow the web interface to more easily edit their policy without disturbing the rest. Like the rest of the job operations, we want the job's owner ("@OWNER") or an administrator ("@SYSTEM") to do it:</P>
8ca02f3c 128
5a738aea 129<PRE CLASS="example">
8ca02f3c 13016 &lt;Limit Cancel-Job CUPS-Authenticate-Job>
13117 Require user @OWNER @SYSTEM
13218 Order deny,allow
13319 &lt;/Limit>
134</PRE>
135
68b10830 136<P>The last <TT>Limit</TT> subsection in any policy uses the special operation name <TT>All</TT>. CUPS will use the rules in this subsection for any operation you don't list specifically in the policy. In this case, all other operations are allowed without a username or authentication:</P>
8ca02f3c 137
5a738aea 138<PRE CLASS="example">
8ca02f3c 13921 &lt;Limit All>
14022 Order deny,allow
14123 &lt;/Limit>
14224 &lt;/Policy>
143</PRE>
144
145
146<DIV CLASS="table"><TABLE WIDTH="80%" SUMMARY="IPP Operation Names">
147<CAPTION>Table 1: <A NAME="TABLE01">IPP Operation Names</A></CAPTION>
148<THEAD>
149<TR>
150 <TH>Name</TH>
151 <TH>Used by CUPS?</TH>
152 <TH>Description</TH>
153</TR>
154</THEAD>
155<TBODY>
156<TR>
2711d865
MS
157 <TD NOWRAP><TT>Activate-Printer</TT></TD>
158 <TD>No</TD>
159 <TD>Activates a printer or class.</TD>
8ca02f3c 160</TR>
161<TR>
2711d865 162 <TD NOWRAP><TT>Cancel-Current-Job</TT></TD>
8ca02f3c 163 <TD>No</TD>
2711d865 164 <TD>Cancels the current job on a printer or class.</TD>
8ca02f3c 165</TR>
166<TR>
2711d865 167 <TD NOWRAP><TT>Cancel-Job</TT></TD>
8ca02f3c 168 <TD>Yes</TD>
2711d865
MS
169 <TD>Cancels a print job.</TD>
170</TR>
171<TR>
172 <TD NOWRAP><TT>Cancel-Jobs</TT></TD>
173 <TD>Yes</TD>
174 <TD>Cancels all print jobs.</TD>
175</TR>
176<TR>
177 <TD NOWRAP><TT>Cancel-My-Jobs</TT></TD>
178 <TD>Yes</TD>
179 <TD>Cancels a user's print job.</TD>
180</TR>
181<TR>
182 <TD NOWRAP><TT>Cancel-Subscription</TT></TD>
183 <TD>Yes</TD>
184 <TD>Cancels an event subscription.</TD>
185</TR>
186<TR>
187 <TD NOWRAP><TT>Close-Job</TT></TD>
188 <TD>Yes</TD>
189 <TD>Closes a user's print job so that it can be printed.</TD>
8ca02f3c 190</TR>
191<TR>
192 <TD NOWRAP><TT>Create-Job</TT></TD>
193 <TD>Yes</TD>
194 <TD>Creates a print job with no files or URIs.</TD>
195</TR>
196<TR>
2711d865 197 <TD NOWRAP><TT>Create-Job-Subscriptions</TT></TD>
8ca02f3c 198 <TD>Yes</TD>
2711d865 199 <TD>Creates one or more event subscriptions for a job.</TD>
8ca02f3c 200</TR>
201<TR>
2711d865
MS
202 <TD NOWRAP><TT>Create-Printer-Subscriptions</TT></TD>
203 <TD>Yes</TD>
204 <TD>Creates one or more event subscriptions for a printer or the server.</TD>
205</TR>
206<TR>
207 <TD NOWRAP><TT>Deactivate-Printer</TT></TD>
8ca02f3c 208 <TD>No</TD>
2711d865 209 <TD>Deactivates a printer or class.</TD>
8ca02f3c 210</TR>
211<TR>
2711d865 212 <TD NOWRAP><TT>Disable-Printer</TT></TD>
8ca02f3c 213 <TD>Yes</TD>
2711d865
MS
214 <TD>Stops a printer or class.</TD>
215</TR>
216<TR>
217 <TD NOWRAP><TT>Enable-Printer</TT></TD>
218 <TD>Yes</TD>
219 <TD>Starts a printer or class.</TD>
8ca02f3c 220</TR>
221<TR>
222 <TD NOWRAP><TT>Get-Job-Attributes</TT></TD>
223 <TD>Yes</TD>
224 <TD>Gets information and options associated with a job.</TD>
225</TR>
226<TR>
227 <TD NOWRAP><TT>Get-Jobs</TT></TD>
228 <TD>Yes</TD>
229 <TD>Gets a list of jobs.</TD>
230</TR>
2711d865
MS
231<TR>
232 <TD NOWRAP><TT>Get-Notifications</TT></TD>
233 <TD>Yes</TD>
234 <TD>Gets (pending) events for an event subscription.</TD>
235</TR>
8ca02f3c 236<TR>
237 <TD NOWRAP><TT>Get-Printer-Attributes</TT></TD>
238 <TD>Yes</TD>
239 <TD>Gets information and options associated with a printer or class.</TD>
240</TR>
241<TR>
2711d865 242 <TD NOWRAP><TT>Get-Printer-Supported-Values</TT></TD>
8ca02f3c 243 <TD>Yes</TD>
2711d865
MS
244 <TD>Gets -supported attributes for a printer based on job
245 options.</TD>
8ca02f3c 246</TR>
247<TR>
2711d865 248 <TD NOWRAP><TT>Get-Subscription-Attributes</TT></TD>
8ca02f3c 249 <TD>Yes</TD>
2711d865 250 <TD>Gets information for an event subscription.</TD>
8ca02f3c 251</TR>
252<TR>
2711d865 253 <TD NOWRAP><TT>Get-Subscriptions</TT></TD>
8ca02f3c 254 <TD>Yes</TD>
2711d865 255 <TD>Gets a list of event subscriptions.</TD>
8ca02f3c 256</TR>
257<TR>
2711d865 258 <TD NOWRAP><TT>Hold-Job</TT></TD>
8ca02f3c 259 <TD>Yes</TD>
2711d865 260 <TD>Holds a print job for printing.</TD>
8ca02f3c 261</TR>
262<TR>
2711d865 263 <TD NOWRAP><TT>Hold-New-Jobs</TT></TD>
8ca02f3c 264 <TD>Yes</TD>
2711d865 265 <TD>Holds new jobs submitted to a printer or class.</TD>
8ca02f3c 266</TR>
267<TR>
2711d865 268 <TD NOWRAP><TT>Pause-Printer</TT></TD>
8ca02f3c 269 <TD>Yes</TD>
2711d865 270 <TD>Stops a printer or class.</TD>
8ca02f3c 271</TR>
272<TR>
2711d865 273 <TD NOWRAP><TT>Pause-Printer-After-Current-Job</TT></TD>
8ca02f3c 274 <TD>No</TD>
2711d865 275 <TD>Stops a printer or class after the current job is finished.</TD>
8ca02f3c 276</TR>
277<TR>
2711d865 278 <TD NOWRAP><TT>Print-Job</TT></TD>
8ca02f3c 279 <TD>Yes</TD>
2711d865 280 <TD>Creates a print job with a single file.</TD>
8ca02f3c 281</TR>
282<TR>
2711d865 283 <TD NOWRAP><TT>Print-URI</TT></TD>
8ca02f3c 284 <TD>No</TD>
2711d865 285 <TD>Create a print job with a single URI.</TD>
8ca02f3c 286</TR>
287<TR>
2711d865
MS
288 <TD NOWRAP><TT>Promote-Job</TT></TD>
289 <TD>No</TD>
290 <TD>Prints a job before others.</TD>
8ca02f3c 291</TR>
292<TR>
2711d865 293 <TD NOWRAP><TT>Purge-Jobs</TT></TD>
8ca02f3c 294 <TD>Yes</TD>
2711d865
MS
295 <TD>Cancels all jobs on the server or a printer or class
296 and removes the job history information.</TD>
8ca02f3c 297</TR>
298<TR>
2711d865 299 <TD NOWRAP><TT>Release-Held-New-Jobs</TT></TD>
8ca02f3c 300 <TD>Yes</TD>
2711d865
MS
301 <TD>Releases jobs that were held because of the
302 Hold-New-Jobs operation.</TD>
8ca02f3c 303</TR>
304<TR>
2711d865 305 <TD NOWRAP><TT>Release-Job</TT></TD>
8ca02f3c 306 <TD>Yes</TD>
2711d865 307 <TD>Releases a print job for printing.</TD>
8ca02f3c 308</TR>
309<TR>
310 <TD NOWRAP><TT>Renew-Subscription</TT></TD>
311 <TD>Yes</TD>
312 <TD>Renews an event subscription that is about to expire.</TD>
313</TR>
314<TR>
2711d865
MS
315 <TD NOWRAP><TT>Reprocess-Job</TT></TD>
316 <TD>No</TD>
317 <TD>Reprints a job on a different printer or class; CUPS has the
318 CUPS-Move-Job operation instead.</TD>
8ca02f3c 319</TR>
320<TR>
2711d865 321 <TD NOWRAP><TT>Restart-Job</TT></TD>
8ca02f3c 322 <TD>Yes</TD>
2711d865 323 <TD>Reprints a print job.</TD>
8ca02f3c 324</TR>
325<TR>
2711d865 326 <TD NOWRAP><TT>Restart-Printer</TT></TD>
8ca02f3c 327 <TD>No</TD>
2711d865 328 <TD>Restarts a printer or class, resuming print jobs as needed.</TD>
8ca02f3c 329</TR>
330<TR>
2711d865 331 <TD NOWRAP><TT>Resubmit-Job</TT></TD>
8ca02f3c 332 <TD>No</TD>
2711d865 333 <TD>Reprints a job with new options.</TD>
8ca02f3c 334</TR>
335<TR>
2711d865
MS
336 <TD NOWRAP><TT>Resume-Job</TT></TD>
337 <TD>No</TD>
338 <TD>Resumes printing of a stopped job.</TD>
8ca02f3c 339</TR>
340<TR>
2711d865 341 <TD NOWRAP><TT>Resume-Printer</TT></TD>
8ca02f3c 342 <TD>Yes</TD>
2711d865 343 <TD>Starts a printer or class.</TD>
8ca02f3c 344</TR>
345<TR>
2711d865 346 <TD NOWRAP><TT>Schedule-Job-After</TT></TD>
8ca02f3c 347 <TD>No</TD>
2711d865 348 <TD>Prints a job after others.</TD>
8ca02f3c 349</TR>
350<TR>
2711d865
MS
351 <TD NOWRAP><TT>Send-Document</TT></TD>
352 <TD>Yes</TD>
353 <TD>Adds a file to a print job.</TD>
8ca02f3c 354</TR>
355<TR>
2711d865 356 <TD NOWRAP><TT>Send-URI</TT></TD>
8ca02f3c 357 <TD>No</TD>
2711d865 358 <TD>Adds a URI to a print job.</TD>
8ca02f3c 359</TR>
360<TR>
2711d865
MS
361 <TD NOWRAP><TT>Set-Printer-Attributes</TT></TD>
362 <TD>Yes</TD>
363 <TD>Sets printer or class information; CUPS uses
364 CUPS-Add-Modify-Printer and CUPS-Add-Modify-Class
365 for most attributes instead.</TD>
8ca02f3c 366</TR>
367<TR>
2711d865
MS
368 <TD NOWRAP><TT>Set-Job-Attributes</TT></TD>
369 <TD>Yes</TD>
370 <TD>Changes job options.</TD>
8ca02f3c 371</TR>
372<TR>
373 <TD NOWRAP><TT>Shutdown-Printer</TT></TD>
374 <TD>No</TD>
375 <TD>Powers a printer or class off.</TD>
376</TR>
377<TR>
378 <TD NOWRAP><TT>Startup-Printer</TT></TD>
379 <TD>No</TD>
380 <TD>Powers a printer or class on.</TD>
381</TR>
8ca02f3c 382<TR>
383 <TD NOWRAP><TT>Suspend-Current-Job</TT></TD>
384 <TD>No</TD>
385 <TD>Stops the current job on a printer or class.</TD>
386</TR>
387<TR>
2711d865 388 <TD NOWRAP><TT>Validate-Document</TT></TD>
8ca02f3c 389 <TD>No</TD>
2711d865 390 <TD>Validates a document request before sending.</TD>
8ca02f3c 391</TR>
392<TR>
2711d865
MS
393 <TD NOWRAP><TT>Validate-Job</TT></TD>
394 <TD>Yes</TD>
395 <TD>Validates a print request before printing.</TD>
8ca02f3c 396</TR>
397<TR>
2711d865 398 <TD NOWRAP><TT>CUPS-Accept-Jobs</TT></TD>
8ca02f3c 399 <TD>Yes</TD>
2711d865
MS
400 <TD>Sets a printer's or class' printer-is-accepting-jobs
401 attribute to true.</TD>
8ca02f3c 402</TR>
403<TR>
2711d865 404 <TD NOWRAP><TT>CUPS-Add-Modify-Class</TT></TD>
8ca02f3c 405 <TD>Yes</TD>
2711d865 406 <TD>Adds or modifies a class.</TD>
8ca02f3c 407</TR>
408<TR>
409 <TD NOWRAP><TT>CUPS-Add-Modify-Printer</TT></TD>
410 <TD>Yes</TD>
411 <TD>Adds or modifies a printer.</TD>
412</TR>
413<TR>
2711d865 414 <TD NOWRAP><TT>CUPS-Authenticate-Job</TT></TD>
8ca02f3c 415 <TD>Yes</TD>
2711d865 416 <TD>Authenticates a job for printing.</TD>
8ca02f3c 417</TR>
418<TR>
3e7fe0ca 419 <TD NOWRAP><TT>CUPS-Delete-Class</TT> *</TD>
8ca02f3c 420 <TD>Yes</TD>
421 <TD>Removes a class.</TD>
422</TR>
423<TR>
2711d865 424 <TD NOWRAP><TT>CUPS-Delete-Printer</TT> *</TD>
8ca02f3c 425 <TD>Yes</TD>
2711d865 426 <TD>Removes a printer.</TD>
8ca02f3c 427</TR>
428<TR>
2711d865 429 <TD NOWRAP><TT>CUPS-Get-Classes</TT> *</TD>
8ca02f3c 430 <TD>Yes</TD>
2711d865 431 <TD>Gets a list of classes.</TD>
8ca02f3c 432</TR>
433<TR>
2711d865 434 <TD NOWRAP><TT>CUPS-Get-Default</TT> *</TD>
8ca02f3c 435 <TD>Yes</TD>
2711d865 436 <TD>Gets the server/network default printer or class.</TD>
8ca02f3c 437</TR>
438<TR>
3e7fe0ca 439 <TD NOWRAP><TT>CUPS-Get-Devices</TT> *</TD>
8ca02f3c 440 <TD>Yes</TD>
441 <TD>Gets a list of printer devices.</TD>
442</TR>
2711d865
MS
443<TR>
444 <TD NOWRAP><TT>CUPS-Get-Document</TT></TD>
445 <TD>Yes</TD>
446 <TD>Retrieves a document file from a job.</TD>
447</TR>
8ca02f3c 448<TR>
3e7fe0ca 449 <TD NOWRAP><TT>CUPS-Get-PPDs</TT> *</TD>
8ca02f3c 450 <TD>Yes</TD>
451 <TD>Gets a list of printer drivers or manufacturers.</TD>
452</TR>
2711d865
MS
453<TR>
454 <TD NOWRAP><TT>CUPS-Get-Printers</TT> *</TD>
455 <TD>Yes</TD>
456 <TD>Gets a list of printers and/or classes.</TD>
457</TR>
8ca02f3c 458<TR>
459 <TD NOWRAP><TT>CUPS-Move-Job</TT></TD>
460 <TD>Yes</TD>
461 <TD>Moves a job to a different printer or class.</TD>
462</TR>
463<TR>
2711d865 464 <TD NOWRAP><TT>CUPS-Reject-Jobs</TT></TD>
8ca02f3c 465 <TD>Yes</TD>
2711d865
MS
466 <TD>Sets a printer's or class' printer-is-accepting-jobs
467 attribute to false.</TD>
8ca02f3c 468</TR>
68b10830 469<TR>
2711d865 470 <TD NOWRAP><TT>CUPS-Set-Default</TT> *</TD>
68b10830 471 <TD>Yes</TD>
2711d865 472 <TD>Sets the server/network default printer or class.</TD>
68b10830 473</TR>
8ca02f3c 474</TBODY>
475</TABLE></DIV>
476
3e7fe0ca 477<P>* = These operations only apply to the default policy.</P>
8ca02f3c 478
479<H2 CLASS="title"><A NAME="CREATING">Creating Your Own Policies</A></H2>
480
68b10830 481<P>The easiest way to create a new policy is to start with the default policy and then make changes to the copy. The first change you'll make is to give the policy a new name. Policy names can use the same characters as a printer name, specifically all printable characters except space, slash (/), and pound (#):</P>
8ca02f3c 482
5a738aea 483<PRE CLASS="example">
8ca02f3c 484&lt;Policy mypolicy>
485</PRE>
486
68b10830 487<P>Then you need to decide exactly what limits you want for the policy. For example, if you want to allow any user to cancel any other users' jobs, you can change the <TT>Cancel-Job</TT> limits to:</P>
8ca02f3c 488
5a738aea 489<PRE CLASS="example">
8ca02f3c 490&lt;Limit Cancel-Job>
491 Order deny,allow
492&lt;/Limit>
493</PRE>
494
37d9646b 495<P>The directives inside the <TT>Limit</TT> subsection can use any of the normal limiting directives: <A HREF="man-cupsd.conf.html#Allow"><TT>Allow</TT></A>, <A HREF="man-cupsd.conf.html#AuthType"><TT>AuthType</TT></A>, <A HREF="man-cupsd.conf.html#Deny"><TT>Deny</TT></A>, <A HREF="man-cupsd.conf.html#Encryption"><TT>Encryption</TT></A>, <A HREF="man-cupsd.conf.html#Require"><TT>Require</TT></A>, and <A HREF="man-cupsd.conf.html#Satisfy"><TT>Satisfy</TT></A>. <A HREF="#TABLE02">Table 2</A> lists some basic "recipes" for different access control rules.</P>
8ca02f3c 496
497<DIV CLASS="table"><TABLE WIDTH="80%" SUMMARY="Access Control Recipes">
498<CAPTION>Table 2: <A NAME="TABLE02">Access Control Recipes</A></CAPTION>
499<THEAD>
500<TR>
501 <TH>Access Level</TH>
502 <TH>Directives to Use</TH>
503</TR>
504</THEAD>
505<TBODY>
506<TR>
507 <TD>Allow Everyone</TD>
508 <TD><PRE>Order deny,allow
509Allow from all</PRE></TD>
510</TR>
511<TR>
512 <TD>Allow Everyone on the Local Network</TD>
513 <TD><PRE>Order deny,allow
514Allow from @LOCAL</PRE></TD>
515</TR>
516<TR>
517 <TD>Deny Everyone/Disable Operation(s)</TD>
68b10830 518 <TD><PRE>Order deny,allow</PRE></TD>
8ca02f3c 519</TR>
520<TR>
521 <TD>Require Login (System) Password</TD>
522 <TD><PRE>AuthType Basic</PRE></TD>
523</TR>
524<TR>
525 <TD>Require CUPS (lppasswd) Password</TD>
526 <TD><PRE>AuthType BasicDigest</PRE></TD>
527</TR>
68b10830
MS
528<TR>
529 <TD>Require Kerberos</TD>
530 <TD><PRE>AuthType Negotiate</PRE></TD>
531</TR>
8ca02f3c 532<TR>
533 <TD>Require the Owner of a Job or Subscription</TD>
534 <TD><PRE>Require user @OWNER</PRE></TD>
535</TR>
536<TR>
537 <TD>Require an Administrative User</TD>
538 <TD><PRE>Require user @SYSTEM</PRE></TD>
539</TR>
540<TR>
541 <TD>Require Member of Group "foogroup"</TD>
542 <TD><PRE>Require user @foogroup</PRE></TD>
543</TR>
544<TR>
545 <TD>Require "john" or "mary"</TD>
546 <TD><PRE>Require user john mary</PRE></TD>
547</TR>
548<TR>
549 <TD>Require Encryption</TD>
550 <TD><PRE>Encryption Required</PRE></TD>
551</TR>
552</TABLE></DIV>
553
554
555<H3>Creating a Policy for a Computer Lab</H3>
556
68b10830 557<P>One common operating scenario is a computer lab. The lab is managed by one or more technicians that assist the users of the lab and handle the basic administration tasks. <A HREF="#LISTING02">Listing 2</A> shows an operation policy that only allows access from the lab's subnet, 10.0.2.x, and allows the lab technicians, who are members of a special UNIX group for that lab called "lab999", to do job, printer, and subscription management operations.</P>
8ca02f3c 558
5a738aea 559<PRE CLASS="example">
8ca02f3c 560<EM>Listing 2: <A NAME="LISTING02">Operation Policy for a Lab</A></EM>
561
562 1 &lt;Policy lab999>
563 2 # Job- and subscription-related operations must be done
355e94dc 564 by the owner, a lab technician, or an administrator...
8ca02f3c 565 3 &lt;Limit Send-Document Send-URI Hold-Job Release-Job
566 Restart-Job Purge-Jobs Set-Job-Attributes
567 Create-Job-Subscription Renew-Subscription
568 Cancel-Subscription Get-Notifications Reprocess-Job
569 Cancel-Current-Job Suspend-Current-Job Resume-Job
68b10830 570 CUPS-Move-Job Cancel-Job CUPS-Authenticate-Job CUPS-Get-Document>
8ca02f3c 571 4 Require user @OWNER @lab999 @SYSTEM
572 5 Order allow,deny
573 6 Allow from 10.0.2.0/24
574 7 &lt;/Limit>
3e7fe0ca 575 8
8ca02f3c 576 9 # All administration operations require a lab technician
355e94dc 577 or an administrator to authenticate...
8ca02f3c 57810 &lt;Limit Pause-Printer Resume-Printer
579 Set-Printer-Attributes Enable-Printer Disable-Printer
580 Pause-Printer-After-Current-Job Hold-New-Jobs
581 Release-Held-New-Jobs Deactivate-Printer Activate-Printer
582 Restart-Printer Shutdown-Printer Startup-Printer
583 Promote-Job Schedule-Job-After CUPS-Accept-Jobs
584 CUPS-Reject-Jobs CUPS-Set-Default>
355e94dc 58511 AuthType Default
8ca02f3c 58612 Require user @lab999 @SYSTEM
58713 Order allow,deny
58814 Allow from 10.0.2.0/24
58915 &lt;/Limit>
59016
59117 # All other operations are allowed from the lab network...
59218 &lt;Limit All>
59319 Order allow,deny
59420 Allow from 10.0.2.0/24
59521 &lt;/Limit>
59622 &lt;/Policy>
597</PRE>
598
599
600<H2 CLASS="title"><A NAME="SELECT">Using Policies</A></H2>
601
37d9646b 602<P>Once you have created a policy, you can use it in two ways. The first way is to assign it as the default policy for the system using the <A HREF="man-cupsd.conf.html#DefaultPolicy"><TT>DefaultPolicy</TT></A> directive in the <VAR>cupsd.conf</VAR> file. For example, add the following line to the <VAR>cupsd.conf</VAR> file to use the "lab999" policy from the previous section:</P>
8ca02f3c 603
5a738aea 604<PRE CLASS="example">
8ca02f3c 605DefaultPolicy lab999
606</PRE>
607
68b10830 608<P>To associate the policy with one or more printers, use either the <A HREF="man-lpadmin.html">lpadmin(8)</A> command or the web interface to change the operation policy for each printer. When using the <B>lpadmin</B> command, the <TT>-o printer-op-policy=name</TT> option sets the operation policy for a printer. For example, enter the following command to use the "lab999" policy from the previous section with a printer named "LaserJet4000":</P>
8ca02f3c 609
610<PRE CLASS="command">
611lpadmin -p LaserJet4000 -o printer-op-policy=lab999
612</PRE>
613
68b10830 614<P>To make the same change in the web interface, go to the printer's web page, for example "http://localhost:631/printers/LaserJet4000", and choose <VAR>Set Default Options</VAR> from the <VAR>Administration</VAR> menu button. Click on the <VAR>Policies</VAR> link and choose the desired policy from the pull-down list. Click on <VAR>Set Default Options</VAR> to change the policy for the printer.</P>
8ca02f3c 615
616</BODY>
617</HTML>