kazu2012 / persevere-framework

Automatically exported from code.google.com/p/persevere-framework
0 stars 0 forks source link

Capability not being persisted on restart of server (1.0) #279

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.
f = new File()
User.createUser("test","test")
t = new TestClass({"name":"test","description":"test"})
User.createUser("test1","test1")
User.grantAccess("test1",f,"full")
User.grantAccess("test1",t,"full")
serialize(load("Capability"))
[
{"id":"Capability/1",
    "members":[
        {"$ref":"User/2"}
    ],
    "full":[
        {"$ref":"File/1"}
    ]
},
{"id":"Capability/2",
    "members":[
        {"$ref":"User/2"}
    ],
    "full":[
        {"$ref":"TestClass/1"}
    ]
}
]

2. CTRL-C to exit out and start server back up.

3.
serialize(load("Capability"))
[
{"id":"Capability/1",
    "members":[
        {"$ref":"User/2"}
    ],
    "full":[
        {"$ref":"File/1"}
    ]
},
{"id":"Capability/2",
    "members":[
        {"$ref":"User/2"}
    ],
    "full":[
        null
    ]
}
]
What is the expected output? What do you see instead?
Capability/2:full is now null, not TestClass/1.

Please use labels and text to provide additional information.

Original issue reported on code.google.com by beau.cro...@gmail.com on 8 Dec 2010 at 7:32

GoogleCodeExporter commented 8 years ago
I believe that problem is usually caused by order of modules and when the 
TestClass definition doesn't get executed before the Capability gets read from 
the DB.

Original comment by kris...@gmail.com on 9 Dec 2010 at 3:57

GoogleCodeExporter commented 8 years ago
Any suggestions for forcing it to load in the correct order?

Original comment by beau.cro...@gmail.com on 9 Dec 2010 at 4:13