1 /*
2  * Policy definitions for the CUPS scheduler.
3  *
4  * Copyright 2007-2010 by Apple Inc.
5  * Copyright 1997-2005 by Easy Software Products, all rights reserved.
6  *
7  * Licensed under Apache License v2.0.  See the file "LICENSE" for more information.
8  */
9 
10 
11 /*
12  * Policy structure...
13  */
14 
15 typedef struct
16 {
17   char			*name;		/* Policy name */
18   cups_array_t		*job_access,	/* Private users/groups for jobs */
19 			*job_attrs,	/* Private attributes for jobs */
20 			*sub_access,	/* Private users/groups for subscriptions */
21 			*sub_attrs,	/* Private attributes for subscriptions */
22 			*ops;		/* Operations */
23 } cupsd_policy_t;
24 
25 typedef struct cupsd_printer_s cupsd_printer_t;
26 
27 
28 /*
29  * Globals...
30  */
31 
32 VAR cups_array_t	*Policies	VALUE(NULL);
33 					/* Policies */
34 
35 
36 /*
37  * Prototypes...
38  */
39 
40 extern cupsd_policy_t	*cupsdAddPolicy(const char *policy);
41 extern cupsd_location_t	*cupsdAddPolicyOp(cupsd_policy_t *p,
42 			                  cupsd_location_t *po,
43 			                  ipp_op_t op);
44 extern http_status_t	cupsdCheckPolicy(cupsd_policy_t *p, cupsd_client_t *con,
45 				         const char *owner);
46 extern void		cupsdDeleteAllPolicies(void);
47 extern cupsd_policy_t	*cupsdFindPolicy(const char *policy);
48 extern cupsd_location_t	*cupsdFindPolicyOp(cupsd_policy_t *p, ipp_op_t op);
49 extern cups_array_t	*cupsdGetPrivateAttrs(cupsd_policy_t *p,
50 			                      cupsd_client_t *con,
51 					      cupsd_printer_t *printer,
52 			                      const char *owner);
53