mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-01 09:52:23 -06:00
from now on, not all unified roles are enabled by default, instead the available roles are hand-picked in the default setup. For advanced use-cases, the administrator is capable to enable the desired set of available roles. Picking roles is not easy since the uid is NOT humanly readable, therefore a cli is contained which lists the available, disabled and enabled roles.
36 lines
756 B
Go
36 lines
756 B
Go
package command
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/owncloud/ocis/v2/ocis-pkg/clihelper"
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
"github.com/owncloud/ocis/v2/services/graph/pkg/config"
|
|
)
|
|
|
|
// GetCommands provides all commands for this service
|
|
func GetCommands(cfg *config.Config) cli.Commands {
|
|
return append([]*cli.Command{
|
|
// start this service
|
|
Server(cfg),
|
|
|
|
// interaction with this service
|
|
|
|
// infos about this service
|
|
Health(cfg),
|
|
Version(cfg),
|
|
}, UnifiedRoles(cfg)...)
|
|
}
|
|
|
|
// Execute is the entry point for the ocis-graph command.
|
|
func Execute(cfg *config.Config) error {
|
|
app := clihelper.DefaultApp(&cli.App{
|
|
Name: "graph",
|
|
Usage: "Serve Graph API for oCIS",
|
|
Commands: GetCommands(cfg),
|
|
})
|
|
return app.RunContext(cfg.Context, os.Args)
|
|
}
|