Skip to content
ksnabb edited this page Nov 17, 2011 · 9 revisions

Database managers

The MongoDB manager uses the following settings from django settings file:

MONGODB_HOST = mongodb host, default: localhost
MONGODB_PORT = port to mongodb host, default: 27017
MONGODB_DBNAME = name of database, default: 'geonition'
MONGOBD_USERNAME = username of person to be authenticated, default: ""
MONGODB_PASSWORD = password for user, default: ""

Installation

Use easy_install from the source tarball. The 'master' branch is the only one that has a setup script at the moment.. wait for the future.

easy_install https://github.com/geonition/django_geonition_utils/tarball/master

Because this application is a collection of commonly used utilities in the other geonition apps no settings or urls needs to be set. Just import geonition_utils where you need it.

Dependencies

Depends on which parts of the utils you use you have different dependencies. One of the big dependencies is mongodb and pymongbo if you want to use the mongodb manager.

Security

Any query (GET, POST, PUT, DELETE) can only be made by authenticated users. (There can be an option of creating an anonymous user and using that for the users that does not want to go through the registration process.)

Authenticated users can only make queries related to themselves and to objects/entities marked as public.

Users might have special permissions to be able to query all information except information marked as allowed to be used only for algorithmic counting...

This results in 3 different levels of secrecy for each entity:

  1. Public information which anyone can query (user defined)
  2. Private information which only admins are allowed to see
    (all information the user has not marked as public, default value)
  3. The superuser or deployer can mark some information (entity type/object)
    as 'secret' which means the information cannot be seen but can be used in some
    algoritmic counting. E.G. if colecting information about homes they can be marked
    as secret but still be used in calculcations such as average distance from home.

From this the geonition API security works in the following way:

Each entity has three different security levels 'secret', 'private', 'public' and each user belongs to one ore more of the security groups 'superuser', 'admin', 'analyzer', 'user'.

another option for the security model

All objects should have a security_level for read, write and delete. The security level can be any numbers from 0 up. 0 would be completely open for read, write and delete. e.g. an object might be defined as security_level = 000000 which would mean that everyone can read, write and delete the object.

All users should have a security_access_level for read, write and delete. e.g. a user has security_access_level = 000000 then this user only has access to objects with a lower security level as the user. Again a user with read access level of 01 can read objects with security level 00 and 01.