1
/****************************************************************************
3
| Copyright (c) 2007 Novell, Inc.
6
| This program is free software; you can redistribute it and/or
7
| modify it under the terms of version 2 of the GNU General Public License as
8
| published by the Free Software Foundation.
10
| This program is distributed in the hope that it will be useful,
11
| but WITHOUT ANY WARRANTY; without even the implied warranty of
12
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
| GNU General Public License for more details.
15
| You should have received a copy of the GNU General Public License
16
| along with this program; if not, contact Novell, Inc.
18
| To contact Novell about this file by physical or electronic mail,
19
| you may find current contact information at www.novell.com
21
| Author: Brady Anderson <banderso@novell.com>
22
|***************************************************************************/
25
using System.Collections;
32
namespace iFolder.WebService
38
public class IdentityPolicy
41
/// The provider imports/authenticates users from
42
/// an external identity source
44
public bool ExternalIdentities;
47
/// The provider can create users
49
public bool CanCreate;
52
/// The provider can delete users
54
public bool CanDelete;
57
/// The provider can modify user properties
59
public bool CanModify;
62
/// The providers friendly name
67
/// The providers description
69
public string Description;
74
public IdentityPolicy()
79
/// Get the Identity Provider's Policy
81
/// <returns>An IdentityPolicy Object</returns>
82
public static IdentityPolicy GetPolicy()
84
IdentityPolicy idPolicy = null;
85
IUserProvider provider = User.GetRegisteredProvider();
86
if ( provider != null )
88
UserProviderCaps caps = provider.GetCapabilities();
91
idPolicy = new IdentityPolicy();
92
idPolicy.CanCreate = caps.CanCreate;
93
idPolicy.CanDelete = caps.CanDelete;
94
idPolicy.CanModify = caps.CanModify;
95
idPolicy.ExternalIdentities = caps.ExternalSync;
96
idPolicy.Name = provider.Name;
97
idPolicy.Description = provider.Description;