| 103 | */ |
| 104 | |
| 105 | http_status_t /* I - 1 if OK, 0 otherwise */ |
| 106 | cupsdCheckPolicy(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 | /* |
no test coverage detected