The paper describes a new approach for treatment security issues in reconfigurable grids used for computing or communication, in particular, in the semantic web environment. The proposed strategy combines a convenient mathematical model, efficient combinatorial algorithms which are robust with respect to changes in the grid structure, and an efficient implementation. The mathematical model uses properties of weighted hypergraphs. Model flexibility enables to describe basic security relations between the nodes such that these relations are preserved under frequent changes in connections of the hypergraph nodes. The algorithms support construction of a grid with embedded security concepts on a given set of nodes. The proposed implementation makes use of the techniques developed for time and space-critical applications in numerical linear algebra. Our combination of the mentioned combined building blocks is targeted to the emerging field of the semantic web, where the security seems to be very important. Nevertheless, the ideas can be generalized to other concepts describable by weighted hypergraphs. The paper concentrates on explaining the model and the algorithms for the chosen application. The consistency of the proposed ideas for security management in the changing grid was verified in a couple of tests with our pilot implementation SECGRID.