~ifolder-dev/simias/trunk-packaging

« back to all changes in this revision

Viewing changes to src/webservices/.svn/text-base/IdentityPolicy.cs.svn-base

  • Committer: Jorge O. Castro
  • Date: 2007-12-03 06:56:46 UTC
  • Revision ID: jorge@ubuntu.com-20071203065646-mupcnjcwgm5mnhyt
* Remove a bunch of .svn directories we no longer need.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
|
3
 
| Copyright (c) 2007 Novell, Inc.
4
 
| All Rights Reserved.
5
 
|
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.
9
 
|
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.
14
 
|
15
 
| You should have received a copy of the GNU General Public License
16
 
| along with this program; if not, contact Novell, Inc.
17
 
|
18
 
| To contact Novell about this file by physical or electronic mail,
19
 
| you may find current contact information at www.novell.com 
20
 
|
21
 
| Author: Brady Anderson <banderso@novell.com>
22
 
|***************************************************************************/
23
 
 
24
 
using System;
25
 
using System.Collections;
26
 
 
27
 
using Simias;
28
 
using Simias.Storage;
29
 
using Simias.Policy;
30
 
using Simias.Server;
31
 
 
32
 
namespace iFolder.WebService
33
 
{
34
 
        /// <summary>
35
 
        /// Identity Policy
36
 
        /// </summary>
37
 
        [Serializable]
38
 
        public class IdentityPolicy 
39
 
        {
40
 
                /// <summary>
41
 
                /// The provider imports/authenticates users from
42
 
                /// an external identity source
43
 
                /// </summary>
44
 
                public bool ExternalIdentities;
45
 
                
46
 
                /// <summary>
47
 
                /// The provider can create users
48
 
                /// </summary>
49
 
                public bool CanCreate;
50
 
                
51
 
                /// <summary>
52
 
                /// The provider can delete users
53
 
                /// </summary>
54
 
                public bool CanDelete;
55
 
 
56
 
                /// <summary>
57
 
                /// The provider can modify user properties
58
 
                /// </summary>
59
 
                public bool CanModify;
60
 
 
61
 
                /// <summary>
62
 
                /// The providers friendly name
63
 
                /// </summary>
64
 
                public string Name;
65
 
 
66
 
                /// <summary>
67
 
                /// The providers description
68
 
                /// </summary>
69
 
                public string Description;
70
 
 
71
 
                /// <summary>
72
 
                /// Constructor
73
 
                /// </summary>
74
 
                public IdentityPolicy()
75
 
                {
76
 
                }
77
 
 
78
 
                /// <summary>
79
 
                /// Get the Identity Provider's Policy
80
 
                /// </summary>
81
 
                /// <returns>An IdentityPolicy Object</returns>
82
 
                public static IdentityPolicy GetPolicy()
83
 
                {
84
 
                        IdentityPolicy idPolicy = null;
85
 
                        IUserProvider provider = User.GetRegisteredProvider();
86
 
                        if ( provider != null )
87
 
                        {
88
 
                                UserProviderCaps caps = provider.GetCapabilities();
89
 
                                if ( caps != null )
90
 
                                {
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;
98
 
                                }
99
 
                        }               
100
 
 
101
 
                        return idPolicy;
102
 
                }
103
 
        }
104
 
}       
105