lspolicy

Lists policies

Applicability

Product

Command type

VersionVault

cleartool subcommand

Platform

UNIX®

Linux®

Windows®

Synopsis

lspolicy [ -obsolete ] [ -principal principal | -me ]
[ -long | -short | -fmt format | -nostatus | -out output_pname ]
[ [ -invob vob-selector [ - unsorted ] | policy-selector ... ]

Description

The lspolicy command lists all policies that are defined in the current VOB. The default behavior is to list all the policies defined in the current VOB.

Restrictions

Authorization

For the default listing, the principal must have the following permissions for all policies that are to be listed:
  • read-info on VOB object
  • read-name on policy
  • read-info on policy
For lspolicy -short, read-info on policy is unnecessary. Policies for which a principal lacks the required permissions are omitted from the listing.

Mastership

(Replicated VOBs only) No mastership restrictions.

Options and arguments

Customizing the listing

-obsolete
Lists obsolete (locked) policies.
-principal principal
Lists policies containing the specified principal.
-me
Lists only those policies where the current user or one of the current user's groups is explicitly contained in the rolemap .
-long
Lists detailed information about each policy in the current VOB, including the policy contents and generic policy information.
-short
Lists policy selectors, but without detailed information about them.
-fmt format-string
Lists information using the specified format string. An additional format specifier is supported, %[implementing_rolemaps]CNQXp: space-separated list of rolemaps that implement this policy, optionally separated by comma (C), new-line (N), enclosed in quotes (Q) and displayed in long format (X).
-nostatus
Implies the -short option and prints out all policy names regardless of lock status.
-out output-pname
Writes a text representation of the policy to the named file. The file contents are suitable for passing to mkpolicy -set.
-invob vob-selector
Lists all policies defined in the specified VOB.
-unsorted
List policies in an unsorted format

Specifying the policy

Default: all policies that are defined in the VOB.

policy-selector
The policy that is to be listed.

Examples

The UNIX system and Linux examples in this section are written for use in csh. If you use another shell, you may need to use different quoting and escaping conventions.

The Windows examples that include wildcards or quoting are written for use in cleartool interactive mode. If you use cleartool single-command mode, you may need to change the wildcards and quoting to make your command interpreter process the command appropriately.

In cleartool single-command mode, cmd-context represents the UNIX system and Linux shells or Windows command interpreter prompt, followed by the cleartool command. In cleartool interactive mode, cmd-context represents the interactive cleartool prompt.

  • List all policies in the VOB product1.

    cmd-context  cleartool lspolicy -long -invob /vobs/product1

  • List all policies in the current VOB that contain a specific user.

    cmd-context  cleartool lspolicy -principal User:hcl.com/bob