MINI MINI MANI MO

Path : /opt/oracle/product/18c/dbhomeXE/R/library/OREembed/doc/man/en/
File Upload :
Current File : //opt/oracle/product/18c/dbhomeXE/R/library/OREembed/doc/man/en/ore.grant.Rd

%
% Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
%
\name{ore.grant}
\alias{ore.grant}
\alias{ore.revoke}
\title{Oracle R Enterprise Privilege Grant and Revoke Functions}
\description{
  Grants or revokes read privilege for an \R script or datastore.
}
\usage{
ore.grant(name, type = c("datastore", "rqscript"), user = NULL)
ore.revoke(name, type = c("datastore", "rqscript"), user = NULL)
}
\arguments{
  \item{name}{
    A character string that specifies the name of an \R script in 
    the \R script repository or the name of a datastore. The current
    user must be the owner of the \R script or datastore.
  }
  \item{type}{
    A scalar character string specifying either 'datastore' or 'rqscript' to 
    grant or revoke the read privilege. This argument must be specified.
  }
  \item{user}{
    An optional character string specifying the user that read privilege of 
    the named \R script or datastore is granted to or revoked from. 
    The default value \code{NULL} indicates the privilege is granted to or 
    revoked from public. 
  }
}
\details{
  Functions \code{\link{ore.grant}} and \code{\link{ore.revoke}} require the 
  user to have the \option{RQADMIN} Oracle Database role.
}
\value{
  Functions \code{ore.grant} and \code{ore.revoke} return an invisible 
  \code{NULL} value if they succeed in privilege grant or revoke; otherwise 
  they produce an error.
}
\references{
  \href{http://www.oracle.com/technetwork/database/database-technologies/r/r-enterprise/documentation/index.html}{Oracle R Enterprise}
}
\author{
  Oracle \email{oracle-r-enterprise@oracle.com}
}
\seealso{
  \code{\link{ore.scriptCreate}},
  \code{\link{ore.scriptDrop}}, 
  \code{\link{ore.scriptLoad}},
  \code{\link{ore.scriptList}},
  \code{\link{ore.load}},
  \code{\link{ore.datastore}},
  \code{\link{ore.datastoreSummary}}
}
\examples{
if (!interactive())
{
  # create an R script for the current user
  ore.scriptCreate("MYLM",
                   function(data, formula, ...) lm(formula, data, ...))
  IRIS <- ore.push(iris)
  ore.tableApply(IRIS[1:4], FUN.NAME = "MYLM",
                 formula = Sepal.Length ~ .)

  # create a global R script available to any user
  ore.scriptCreate("GLBGLM",
                   function(data, formula, ...) 
                     glm(formula=formula, data=data, ...),
                   global = TRUE)
  ore.tableApply(IRIS[1:4], FUN.NAME = "GLBGLM",
                 formula = Sepal.Length ~ .) 

  # list R scripts 
  ore.scriptList()
  ore.scriptList(pattern="LM", type="all")

  # load an R script to an R function object
  ore.scriptLoad(name="MYLM")
  ore.scriptLoad(name="GLBGLM", newname="MYGLM")
  MYLM(iris, formula = Sepal.Length ~ .)
  MYGLM(iris, formula = Sepal.Length ~ .)

  # grant and revoke R script read privilege to and from public
  ore.grant(name = "MYLM", type = "rqscript")
  ore.scriptList(type="grant")
  ore.revoke(name = "MYLM", type = "rqscript")
  ore.scriptList(type="grant")  

  # drop an R script
  ore.scriptDrop("MYLM")
  ore.scriptDrop("GLBGLM", global=TRUE)

  ore.scriptList(type="all")

  # create grantable datastores
  ore.save(iris, name="ds_1", grantable=TRUE)
  ore.save(mtcars, name="ds_2", grantable=TRUE)

  # grant the read privilege of one datastore to every user
  ore.grant(name="ds_1", type="datastore", user=NULL)

  # show all the datastores
  ore.datastore(type="all")[,-5L]

  # show the grantable datstores
  ore.datastore(type="grantable")[, -4L]

  # show the datastoe the read privilege for which was granted to other users
  ore.datastore(type="grant")

  # revoke the granted privilege 
  ore.revoke(name="ds_1", type="datastore", user=NULL)

  ore.delete(name="ds_1")
  ore.delete(name="ds_2")
}
}
\keyword{programming}
\keyword{database}
\keyword{ORE}

OHA YOOOO