| 1164 | } |
| 1165 | |
| 1166 | ::CORBA::Boolean AccessControlBuiltInImpl::get_topic_sec_attributes( |
| 1167 | ::DDS::Security::PermissionsHandle permissions_handle, |
| 1168 | const char * topic_name, |
| 1169 | ::DDS::Security::TopicSecurityAttributes & attributes, |
| 1170 | ::DDS::Security::SecurityException & ex) |
| 1171 | { |
| 1172 | if (DDS::HANDLE_NIL == permissions_handle) { |
| 1173 | CommonUtilities::set_security_error(ex, -1, 0, "AccessControlBuiltInImpl::get_topic_sec_attributes: Invalid permissions handle"); |
| 1174 | return false; |
| 1175 | } |
| 1176 | if (0 == topic_name) { |
| 1177 | CommonUtilities::set_security_error(ex, -1, 0, "AccessControlBuiltInImpl::get_topic_sec_attributes: Invalid topic name"); |
| 1178 | return false; |
| 1179 | } |
| 1180 | |
| 1181 | // Extract Governance and the permissions data for the requested handle |
| 1182 | |
| 1183 | ACE_GUARD_RETURN(ACE_Thread_Mutex, guard, handle_mutex_, false); |
| 1184 | |
| 1185 | ACPermsMap::iterator piter = local_ac_perms_.find(permissions_handle); |
| 1186 | |
| 1187 | if (piter == local_ac_perms_.end()) { |
| 1188 | CommonUtilities::set_security_error(ex, -1, 0, "AccessControlBuiltInImpl::get_topic_sec_attributes: No matching permissions handle present"); |
| 1189 | return false; |
| 1190 | } |
| 1191 | |
| 1192 | gov_iter begin = piter->second.gov->access_rules().begin(); |
| 1193 | gov_iter end = piter->second.gov->access_rules().end(); |
| 1194 | |
| 1195 | for (gov_iter giter = begin; giter != end; ++giter) { |
| 1196 | |
| 1197 | if (giter->domains.has(piter->second.domain_id)) { |
| 1198 | Governance::TopicAccessRules::iterator tr_iter; |
| 1199 | |
| 1200 | for (tr_iter = giter->topic_rules.begin(); tr_iter != giter->topic_rules.end(); ++tr_iter) { |
| 1201 | if (pattern_match(topic_name, tr_iter->topic_expression.c_str())) { |
| 1202 | attributes = tr_iter->topic_attrs; |
| 1203 | return true; |
| 1204 | } |
| 1205 | } |
| 1206 | } |
| 1207 | } |
| 1208 | |
| 1209 | CommonUtilities::set_security_error(ex,-1, 0, "AccessControlBuiltInImpl::get_topic_sec_attributes: No matching domain/topic in governance"); |
| 1210 | return false; |
| 1211 | } |
| 1212 | |
| 1213 | ::CORBA::Boolean AccessControlBuiltInImpl::get_datawriter_sec_attributes( |
| 1214 | ::DDS::Security::PermissionsHandle permissions_handle, |
no test coverage detected