1<HTML> 2<!-- SECTION: Getting Started --> 3<HEAD> 4 <TITLE>Managing Operation Policies</TITLE> 5 <LINK REL="STYLESHEET" TYPE="text/css" HREF="/cups-printable.css"> 6</HEAD> 7<BODY> 8 9<H1 CLASS="title">Managing Operation Policies</H1> 10 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> 14 15<H2 CLASS="title"><A NAME="BASICS">The Basics</A></H2> 16 17<P>Operation policies are used for all IPP requests sent to the scheduler and are evaluated <em>after</em> the <A HREF="ref-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> 18 19<P>Policies are stored in the <VAR>cupsd.conf</VAR> file in <A HREF="ref-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="ref-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> 21 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="ref-cupsd-conf.html">restart the cupsd process</A> before trying to use the new policy.</P> 23 24<PRE CLASS="example"> 25<EM>Listing 1: <A NAME="LISTING01">Default Operation Policy</A></EM> 26 27 1 <Policy default> 28 2 # Job-related operations must be done by the owner or an 29 administrator... 30 3 <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 35 CUPS-Move-Job CUPS-Get-Document> 36 4 Require user @OWNER @SYSTEM 37 5 Order deny,allow 38 6 </Limit> 39 7 40 8 # All administration operations require an administrator 41 to authenticate... 42 9 <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class 43 CUPS-Delete-Class CUPS-Set-Default> 4410 AuthType Default 4511 Require user @SYSTEM 4612 Order deny,allow 4713 </Limit> 4814 4915 # All printer operations require a printer operator 50 to authenticate... 5116 <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 </Limit> 6221 6322 # Only the owner or an administrator can cancel or 64 authenticate a job... 6523 <Limit Cancel-Job CUPS-Authenticate-Job> 6624 Require user @OWNER @SYSTEM 6725 Order deny,allow 6826 </Limit> 6927 7028 <Limit All> 7129 Order deny,allow 7230 </Limit> 7331 </Policy> 74</PRE> 75 76<H3>The Default CUPS Operation Policy</H3> 77 78<P>The policy definition starts with an opening <TT>Policy</TT> directive:</P> 79 80<PRE CLASS="example"> 81 1 <Policy default> 82</PRE> 83 84<P>The first <TT>Limit</TT> subsection defines the rules for IPP job operations:</P> 85 86<PRE CLASS="example"> 87 3 <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 92 CUPS-Move-Job CUPS-Get-Document> 93 4 Require user @OWNER @SYSTEM 94 5 Order deny,allow 95 6 </Limit> 96</PRE> 97 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 100<P>The access control rules are listed after the <TT>Limit</TT> line and are the same as those used for <A HREF="ref-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="ref-cupsd-conf.html#SystemGroup"><TT>SystemGroup</TT></A> ("@SYSTEM") to do the operation. Because we do not include an <A HREF="ref-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> 101 102<PRE CLASS="example"> 103 9 <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class 104 CUPS-Delete-Class CUPS-Set-Default> 10510 AuthType Default 10611 Require user @SYSTEM 10712 Order deny,allow 10813 </Limit> 10914 11015 # All printer operations require a printer operator 111 to authenticate... 11216 <Limit Pause-Printer Resume-Printer 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 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 </Limit> 123</PRE> 124 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> 126 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> 128 129<PRE CLASS="example"> 13016 <Limit Cancel-Job CUPS-Authenticate-Job> 13117 Require user @OWNER @SYSTEM 13218 Order deny,allow 13319 </Limit> 134</PRE> 135 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> 137 138<PRE CLASS="example"> 13921 <Limit All> 14022 Order deny,allow 14123 </Limit> 14224 </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> 157 <TD NOWRAP><TT>Print-Job</TT></TD> 158 <TD>Yes</TD> 159 <TD>Creates a print job with a single file.</TD> 160</TR> 161<TR> 162 <TD NOWRAP><TT>Print-URI</TT></TD> 163 <TD>No</TD> 164 <TD>Create a print job with a single URI.</TD> 165</TR> 166<TR> 167 <TD NOWRAP><TT>Validate-Job</TT></TD> 168 <TD>Yes</TD> 169 <TD>Validates a print request before printing.</TD> 170</TR> 171<TR> 172 <TD NOWRAP><TT>Create-Job</TT></TD> 173 <TD>Yes</TD> 174 <TD>Creates a print job with no files or URIs.</TD> 175</TR> 176<TR> 177 <TD NOWRAP><TT>Send-Document</TT></TD> 178 <TD>Yes</TD> 179 <TD>Adds a file to a print job.</TD> 180</TR> 181<TR> 182 <TD NOWRAP><TT>Send-URI</TT></TD> 183 <TD>No</TD> 184 <TD>Adds a URI to a print job.</TD> 185</TR> 186<TR> 187 <TD NOWRAP><TT>Cancel-Job</TT></TD> 188 <TD>Yes</TD> 189 <TD>Cancels a print job.</TD> 190</TR> 191<TR> 192 <TD NOWRAP><TT>Get-Job-Attributes</TT></TD> 193 <TD>Yes</TD> 194 <TD>Gets information and options associated with a job.</TD> 195</TR> 196<TR> 197 <TD NOWRAP><TT>Get-Jobs</TT></TD> 198 <TD>Yes</TD> 199 <TD>Gets a list of jobs.</TD> 200</TR> 201<TR> 202 <TD NOWRAP><TT>Get-Printer-Attributes</TT></TD> 203 <TD>Yes</TD> 204 <TD>Gets information and options associated with a printer or class.</TD> 205</TR> 206<TR> 207 <TD NOWRAP><TT>Hold-Job</TT></TD> 208 <TD>Yes</TD> 209 <TD>Holds a print job for printing.</TD> 210</TR> 211<TR> 212 <TD NOWRAP><TT>Release-Job</TT></TD> 213 <TD>Yes</TD> 214 <TD>Releases a print job for printing.</TD> 215</TR> 216<TR> 217 <TD NOWRAP><TT>Restart-Job</TT></TD> 218 <TD>Yes</TD> 219 <TD>Reprints a print job.</TD> 220</TR> 221<TR> 222 <TD NOWRAP><TT>Pause-Printer</TT></TD> 223 <TD>Yes</TD> 224 <TD>Stops a printer or class.</TD> 225</TR> 226<TR> 227 <TD NOWRAP><TT>Resume-Printer</TT></TD> 228 <TD>Yes</TD> 229 <TD>Starts a printer or class.</TD> 230</TR> 231<TR> 232 <TD NOWRAP><TT>Purge-Jobs</TT></TD> 233 <TD>Yes</TD> 234 <TD>Cancels all jobs on the server or a printer or class 235 and removes the job history information.</TD> 236</TR> 237<TR> 238 <TD NOWRAP><TT>Set-Printer-Attributes</TT></TD> 239 <TD>No</TD> 240 <TD>Sets printer or class information; CUPS uses 241 CUPS-Add-Modify-Printer and CUPS-Add-Modify-Class 242 instead.</TD> 243</TR> 244<TR> 245 <TD NOWRAP><TT>Set-Job-Attributes</TT></TD> 246 <TD>Yes</TD> 247 <TD>Changes job options.</TD> 248</TR> 249<TR> 250 <TD NOWRAP><TT>Get-Printer-Supported-Values</TT></TD> 251 <TD>No</TD> 252 <TD>Gets -supported attributes for a printer based on job 253 options.</TD> 254</TR> 255<TR> 256 <TD NOWRAP><TT>Create-Printer-Subscription</TT></TD> 257 <TD>Yes</TD> 258 <TD>Creates an event subscription for a printer or the server.</TD> 259</TR> 260<TR> 261 <TD NOWRAP><TT>Create-Job-Subscription</TT></TD> 262 <TD>Yes</TD> 263 <TD>Creates an event subscription for a job.</TD> 264</TR> 265<TR> 266 <TD NOWRAP><TT>Get-Subscription-Attributes</TT></TD> 267 <TD>Yes</TD> 268 <TD>Gets information for an event subscription.</TD> 269</TR> 270<TR> 271 <TD NOWRAP><TT>Get-Subscriptions</TT></TD> 272 <TD>Yes</TD> 273 <TD>Gets a list of event subscriptions.</TD> 274</TR> 275<TR> 276 <TD NOWRAP><TT>Renew-Subscription</TT></TD> 277 <TD>Yes</TD> 278 <TD>Renews an event subscription that is about to expire.</TD> 279</TR> 280<TR> 281 <TD NOWRAP><TT>Cancel-Subscription</TT></TD> 282 <TD>Yes</TD> 283 <TD>Cancels an event subscription.</TD> 284</TR> 285<TR> 286 <TD NOWRAP><TT>Get-Notifications</TT></TD> 287 <TD>Yes</TD> 288 <TD>Gets (pending) events for an event subscription.</TD> 289</TR> 290<TR> 291 <TD NOWRAP><TT>Send-Notifications</TT></TD> 292 <TD>No</TD> 293 <TD>Sends events for an event subscription.</TD> 294</TR> 295<TR> 296 <TD NOWRAP><TT>Get-Printer-Support-Files</TT></TD> 297 <TD>No</TD> 298 <TD>Gets printer driver files for a Novell client.</TD> 299</TR> 300<TR> 301 <TD NOWRAP><TT>Enable-Printer</TT></TD> 302 <TD>Yes</TD> 303 <TD>Starts a printer or class.</TD> 304</TR> 305<TR> 306 <TD NOWRAP><TT>Disable-Printer</TT></TD> 307 <TD>Yes</TD> 308 <TD>Stops a printer or class.</TD> 309</TR> 310<TR> 311 <TD NOWRAP><TT>Pause-Printer-After-Current-Job</TT></TD> 312 <TD>No</TD> 313 <TD>Stops a printer or class after the current job is finished.</TD> 314</TR> 315<TR> 316 <TD NOWRAP><TT>Hold-New-Jobs</TT></TD> 317 <TD>No</TD> 318 <TD>Holds new jobs submitted to a printer or class.</TD> 319</TR> 320<TR> 321 <TD NOWRAP><TT>Release-Held-New-Jobs</TT></TD> 322 <TD>No</TD> 323 <TD>Releases jobs that were held because of the 324 Hold-New-Jobs operation.</TD> 325</TR> 326<TR> 327 <TD NOWRAP><TT>Deactivate-Printer</TT></TD> 328 <TD>No</TD> 329 <TD>Deactivates a printer or class.</TD> 330</TR> 331<TR> 332 <TD NOWRAP><TT>Activate-Printer</TT></TD> 333 <TD>No</TD> 334 <TD>Activates a printer or class.</TD> 335</TR> 336<TR> 337 <TD NOWRAP><TT>Restart-Printer</TT></TD> 338 <TD>No</TD> 339 <TD>Restarts a printer or class, resuming print jobs as needed.</TD> 340</TR> 341<TR> 342 <TD NOWRAP><TT>Shutdown-Printer</TT></TD> 343 <TD>No</TD> 344 <TD>Powers a printer or class off.</TD> 345</TR> 346<TR> 347 <TD NOWRAP><TT>Startup-Printer</TT></TD> 348 <TD>No</TD> 349 <TD>Powers a printer or class on.</TD> 350</TR> 351<TR> 352 <TD NOWRAP><TT>Reprocess-Job</TT></TD> 353 <TD>No</TD> 354 <TD>Reprints a job on a different printer or class; CUPS has the 355 CUPS-Move-Job operation instead.</TD> 356</TR> 357<TR> 358 <TD NOWRAP><TT>Cancel-Current-Job</TT></TD> 359 <TD>No</TD> 360 <TD>Cancels the current job on a printer or class.</TD> 361</TR> 362<TR> 363 <TD NOWRAP><TT>Suspend-Current-Job</TT></TD> 364 <TD>No</TD> 365 <TD>Stops the current job on a printer or class.</TD> 366</TR> 367<TR> 368 <TD NOWRAP><TT>Resume-Job</TT></TD> 369 <TD>No</TD> 370 <TD>Resumes printing of a stopped job.</TD> 371</TR> 372<TR> 373 <TD NOWRAP><TT>Promote-Job</TT></TD> 374 <TD>No</TD> 375 <TD>Prints a job before others.</TD> 376</TR> 377<TR> 378 <TD NOWRAP><TT>Schedule-Job-After</TT></TD> 379 <TD>No</TD> 380 <TD>Prints a job after others.</TD> 381</TR> 382<TR> 383 <TD NOWRAP><TT>CUPS-Get-Default</TT> *</TD> 384 <TD>Yes</TD> 385 <TD>Gets the server/network default printer or class.</TD> 386</TR> 387<TR> 388 <TD NOWRAP><TT>CUPS-Get-Printers</TT> *</TD> 389 <TD>Yes</TD> 390 <TD>Gets a list of printers and/or classes.</TD> 391</TR> 392<TR> 393 <TD NOWRAP><TT>CUPS-Add-Modify-Printer</TT></TD> 394 <TD>Yes</TD> 395 <TD>Adds or modifies a printer.</TD> 396</TR> 397<TR> 398 <TD NOWRAP><TT>CUPS-Delete-Printer</TT> *</TD> 399 <TD>Yes</TD> 400 <TD>Removes a printer.</TD> 401</TR> 402<TR> 403 <TD NOWRAP><TT>CUPS-Get-Classes</TT> *</TD> 404 <TD>Yes</TD> 405 <TD>Gets a list of classes.</TD> 406</TR> 407<TR> 408 <TD NOWRAP><TT>CUPS-Add-Modify-Class</TT></TD> 409 <TD>Yes</TD> 410 <TD>Adds or modifies a class.</TD> 411</TR> 412<TR> 413 <TD NOWRAP><TT>CUPS-Delete-Class</TT> *</TD> 414 <TD>Yes</TD> 415 <TD>Removes a class.</TD> 416</TR> 417<TR> 418 <TD NOWRAP><TT>CUPS-Accept-Jobs</TT></TD> 419 <TD>Yes</TD> 420 <TD>Sets a printer's or class' printer-is-accepting-jobs 421 attribute to true.</TD> 422</TR> 423<TR> 424 <TD NOWRAP><TT>CUPS-Reject-Jobs</TT></TD> 425 <TD>Yes</TD> 426 <TD>Sets a printer's or class' printer-is-accepting-jobs 427 attribute to false.</TD> 428</TR> 429<TR> 430 <TD NOWRAP><TT>CUPS-Set-Default</TT> *</TD> 431 <TD>Yes</TD> 432 <TD>Sets the server/network default printer or class.</TD> 433</TR> 434<TR> 435 <TD NOWRAP><TT>CUPS-Get-Devices</TT> *</TD> 436 <TD>Yes</TD> 437 <TD>Gets a list of printer devices.</TD> 438</TR> 439<TR> 440 <TD NOWRAP><TT>CUPS-Get-PPDs</TT> *</TD> 441 <TD>Yes</TD> 442 <TD>Gets a list of printer drivers or manufacturers.</TD> 443</TR> 444<TR> 445 <TD NOWRAP><TT>CUPS-Move-Job</TT></TD> 446 <TD>Yes</TD> 447 <TD>Moves a job to a different printer or class.</TD> 448</TR> 449<TR> 450 <TD NOWRAP><TT>CUPS-Authenticate-Job</TT></TD> 451 <TD>Yes</TD> 452 <TD>Authenticates a job for printing.</TD> 453</TR> 454<TR> 455 <TD NOWRAP><TT>CUPS-Get-Document</TT></TD> 456 <TD>Yes</TD> 457 <TD>Retrieves a document file from a job.</TD> 458</TR> 459</TBODY> 460</TABLE></DIV> 461 462<P>* = These operations only apply to the default policy.</P> 463 464<H2 CLASS="title"><A NAME="CREATING">Creating Your Own Policies</A></H2> 465 466<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> 467 468<PRE CLASS="example"> 469<Policy mypolicy> 470</PRE> 471 472<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> 473 474<PRE CLASS="example"> 475<Limit Cancel-Job> 476 Order deny,allow 477</Limit> 478</PRE> 479 480<P>The directives inside the <TT>Limit</TT> subsection can use any of the normal limiting directives: <A HREF="ref-cupsd-conf.html#Allow"><TT>Allow</TT></A>, <A HREF="ref-cupsd-conf.html#AuthType"><TT>AuthType</TT></A>, <A HREF="ref-cupsd-conf.html#Deny"><TT>Deny</TT></A>, <A HREF="ref-cupsd-conf.html#Encryption"><TT>Encryption</TT></A>, <A HREF="ref-cupsd-conf.html#Require"><TT>Require</TT></A>, and <A HREF="ref-cupsd-conf.html#Satisfy"><TT>Satisfy</TT></A>. <A HREF="#TABLE02">Table 2</A> lists some basic "recipes" for different access control rules.</P> 481 482<DIV CLASS="table"><TABLE WIDTH="80%" SUMMARY="Access Control Recipes"> 483<CAPTION>Table 2: <A NAME="TABLE02">Access Control Recipes</A></CAPTION> 484<THEAD> 485<TR> 486 <TH>Access Level</TH> 487 <TH>Directives to Use</TH> 488</TR> 489</THEAD> 490<TBODY> 491<TR> 492 <TD>Allow Everyone</TD> 493 <TD><PRE>Order deny,allow 494Allow from all</PRE></TD> 495</TR> 496<TR> 497 <TD>Allow Everyone on the Local Network</TD> 498 <TD><PRE>Order deny,allow 499Allow from @LOCAL</PRE></TD> 500</TR> 501<TR> 502 <TD>Deny Everyone/Disable Operation(s)</TD> 503 <TD><PRE>Order deny,allow</PRE></TD> 504</TR> 505<TR> 506 <TD>Require Login (System) Password</TD> 507 <TD><PRE>AuthType Basic</PRE></TD> 508</TR> 509<TR> 510 <TD>Require CUPS (lppasswd) Password</TD> 511 <TD><PRE>AuthType BasicDigest</PRE></TD> 512</TR> 513<TR> 514 <TD>Require Kerberos</TD> 515 <TD><PRE>AuthType Negotiate</PRE></TD> 516</TR> 517<TR> 518 <TD>Require the Owner of a Job or Subscription</TD> 519 <TD><PRE>Require user @OWNER</PRE></TD> 520</TR> 521<TR> 522 <TD>Require an Administrative User</TD> 523 <TD><PRE>Require user @SYSTEM</PRE></TD> 524</TR> 525<TR> 526 <TD>Require Member of Group "foogroup"</TD> 527 <TD><PRE>Require user @foogroup</PRE></TD> 528</TR> 529<TR> 530 <TD>Require "john" or "mary"</TD> 531 <TD><PRE>Require user john mary</PRE></TD> 532</TR> 533<TR> 534 <TD>Require Encryption</TD> 535 <TD><PRE>Encryption Required</PRE></TD> 536</TR> 537</TABLE></DIV> 538 539 540<H3>Creating a Policy for a Computer Lab</H3> 541 542<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> 543 544<PRE CLASS="example"> 545<EM>Listing 2: <A NAME="LISTING02">Operation Policy for a Lab</A></EM> 546 547 1 <Policy lab999> 548 2 # Job- and subscription-related operations must be done 549 by the owner, a lab technician, or an administrator... 550 3 <Limit Send-Document Send-URI Hold-Job Release-Job 551 Restart-Job Purge-Jobs Set-Job-Attributes 552 Create-Job-Subscription Renew-Subscription 553 Cancel-Subscription Get-Notifications Reprocess-Job 554 Cancel-Current-Job Suspend-Current-Job Resume-Job 555 CUPS-Move-Job Cancel-Job CUPS-Authenticate-Job CUPS-Get-Document> 556 4 Require user @OWNER @lab999 @SYSTEM 557 5 Order allow,deny 558 6 Allow from 10.0.2.0/24 559 7 </Limit> 560 8 561 9 # All administration operations require a lab technician 562 or an administrator to authenticate... 56310 <Limit Pause-Printer Resume-Printer 564 Set-Printer-Attributes Enable-Printer Disable-Printer 565 Pause-Printer-After-Current-Job Hold-New-Jobs 566 Release-Held-New-Jobs Deactivate-Printer Activate-Printer 567 Restart-Printer Shutdown-Printer Startup-Printer 568 Promote-Job Schedule-Job-After CUPS-Accept-Jobs 569 CUPS-Reject-Jobs CUPS-Set-Default> 57011 AuthType Default 57112 Require user @lab999 @SYSTEM 57213 Order allow,deny 57314 Allow from 10.0.2.0/24 57415 </Limit> 57516 57617 # All other operations are allowed from the lab network... 57718 <Limit All> 57819 Order allow,deny 57920 Allow from 10.0.2.0/24 58021 </Limit> 58122 </Policy> 582</PRE> 583 584 585<H2 CLASS="title"><A NAME="SELECT">Using Policies</A></H2> 586 587<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="ref-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> 588 589<PRE CLASS="example"> 590DefaultPolicy lab999 591</PRE> 592 593<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> 594 595<PRE CLASS="command"> 596lpadmin -p LaserJet4000 -o printer-op-policy=lab999 597</PRE> 598 599<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> 600 601</BODY> 602</HTML> 603