@Override
    @Transactional
    public InternalType createObject(ModeledAuthenticatedUser user, ExternalType object)
        throws GuacamoleException {

        ModelType model = getModelInstance(user, object);
        beforeCreate(user, object, model);
        
        // Create object
        getObjectMapper().insert(model);

        // Set identifier on original object
        object.setIdentifier(model.getIdentifier());

        // Add implicit permissions
        Collection<ObjectPermissionModel> implicitPermissions = getImplicitPermissions(user, model);
        if (!implicitPermissions.isEmpty())
            getPermissionMapper().insert(implicitPermissions, getCaseSensitivity());

        // Add any arbitrary attributes
        if (model.hasArbitraryAttributes())
            getObjectMapper().insertAttributes(model);

        return getObjectInstance(user, model);

    }
Returns an immutable collection of permissions that should be granted due
to the creation of the given object. These permissions need not be
granted solely to the user creating the object.

@param user
    The user creating the object.

@param model
    The object being created.

@return
    The collection of implicit permissions that should be granted due to
    the creation of the given object.
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/base/ModeledDirectoryObjectService.java