Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
cubes
awstats
Commits
039ef37ddca5
Commit
8636fb67
authored
May 24, 2011
by
Arthur Lutz
Browse files
added permission so that only admin accounts can see stats
parent
0b0004de58e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
schema.py
View file @
039ef37d
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment