Skip to content
This repository has been archived by the owner on Oct 12, 2020. It is now read-only.

change to CreateApp from CreateDocEx #20

Merged
merged 1 commit into from Dec 4, 2018
Merged

Conversation

FredrikFolkesson
Copy link
Contributor

Changes from CreateDocEx to CreateApp since CreateDocEx is only supposed to work in desktop mode and with ABAC engine runs in Scalable mode.

Had to make some other minor changes since CreateApp does not return the doc object as CreateDocEx does.

@@ -134,15 +134,17 @@ func TestAccessReloadEngine(t *testing.T) {

// testCanCreateApp verifies that the current user can create an app.
func testCanCreateApp(t *testing.T) {
testState.app, err = createApp(testState.global, appName)
success := false
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to create the variable before using it here since := cant be used when saving to a field.
(for testState.appID)

access/access.go Outdated
func createApp(global *enigma.Global, appName string) (*enigma.Doc, error) {
return global.CreateDocEx(ctx, appName, "", "", "", "Main")
func createApp(global *enigma.Global, appName string) (bool, string, error) {
return global.CreateApp(ctx, appName, "Main")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't you store appId here and return global.OpenDoc(appId) and have rest of the code as it was?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that makes a lot more sense :)

Copy link
Member

@wennmo wennmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with @peol comment regarding opening doc in createApp. Otherwise it looks good to me.

@wennmo wennmo merged commit 768fd9d into master Dec 4, 2018
@wennmo wennmo deleted the change-to-createApp branch December 4, 2018 09:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants