MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cupsdCheckPolicy

Function cupsdCheckPolicy

scheduler/policy.c:105–141  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103 */
104
105http_status_t /* I - 1 if OK, 0 otherwise */
106cupsdCheckPolicy(cupsd_policy_t *p, /* I - Policy */
107 cupsd_client_t *con, /* I - Client connection */
108 const char *owner) /* I - Owner of object */
109{
110 cupsd_location_t *po; /* Current policy operation */
111
112
113 /*
114 * Range check...
115 */
116
117 if (!p || !con)
118 {
119 cupsdLogMessage(CUPSD_LOG_CRIT, "cupsdCheckPolicy: p=%p, con=%p.", p, con);
120
121 return (HTTP_STATUS_SERVER_ERROR);
122 }
123
124 /*
125 * Find a match for the operation...
126 */
127
128 if ((po = cupsdFindPolicyOp(p, con->request->request.op.operation_id)) == NULL)
129 {
130 cupsdLogMessage(CUPSD_LOG_DEBUG2, "cupsdCheckPolicy: No matching operation, returning 0.");
131 return (HTTP_STATUS_OK);
132 }
133
134 con->best = po;
135
136 /*
137 * Return the status of the check...
138 */
139
140 return (cupsdIsAuthorized(con, owner));
141}
142
143
144/*

Callers 15

accept_jobsFunction · 0.85
add_classFunction · 0.85
add_jobFunction · 0.85
add_printerFunction · 0.85
cancel_all_jobsFunction · 0.85
cancel_subscriptionFunction · 0.85
create_local_printerFunction · 0.85
create_subscriptionsFunction · 0.85
delete_printerFunction · 0.85
get_defaultFunction · 0.85
get_devicesFunction · 0.85
get_documentFunction · 0.85

Calls 3

cupsdLogMessageFunction · 0.85
cupsdFindPolicyOpFunction · 0.85
cupsdIsAuthorizedFunction · 0.85

Tested by

no test coverage detected