Commit 8636fb67 authored by Arthur Lutz's avatar Arthur Lutz
Browse files

added permission so that only admin accounts can see stats

parent 0b0004de58e0
......@@ -16,19 +16,29 @@
"""cubicweb-awstats schema"""
from yams.buildobjs import (EntityType, String, Int, Date, Boolean,
from yams.buildobjs import (EntityType, String, Int, Date, Datetime, Boolean,
SubjectRelation, RelationDefinition, RelationType)
_ = unicode
MANAGER_PERMISSIONS = {
'read': ('managers', ),
'update': ('managers', 'owners',),
'delete': ('managers', 'owners'),
'add': ('managers',)
}
class StatPeriod(EntityType):
__permissions__ = MANAGER_PERMISSIONS
# FIXME - use DateTime if periodicity is hour ? (optimisation in db?)
start = Date()
stop = Date()
class Hits(EntityType):
__permissions__ = MANAGER_PERMISSIONS
name = String(maxsize=128)
hit_type = String(maxsize=128)
count = Int()
period = SubjectRelation('StatPeriod', cardinality='?*')
# to establish a link with the entity you want to build stats for
# you need to create a relationship Hits "stats_about" X
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment